Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Help with maths homework

Author
Message
Shady 2005 Simpson
21
Years of Service
User Offline
Joined: 26th Aug 2003
Location: Newcastle, England
Posted: 15th Sep 2003 19:52
Hi,

I'm kinda fed up with my homework, my task is to list all the prime numbers from 1 to 1000 finding "the quick way" to do it.
He says that there is a real quick way, does anyone know what it is?

Thanx.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 15th Sep 2003 19:55 Edited at: 15th Sep 2003 19:57
There is, but its something you need to find out for yourself.

No full answers please people - teachers are getting wise to the internet, and we dont want Shady to be accused of plagarism...


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 15th Sep 2003 20:24
Reminds me of when a friend copied na entrie David Beckham off Hello!'s website. Sentences like "His recent sending off in the world cup" gave it away

c:/dos
c:/dos run
run dos run
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 15th Sep 2003 21:00
Yes, that was a bit stupid


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
Damokles
21
Years of Service
User Offline
Joined: 28th May 2003
Location: Belgium
Posted: 15th Sep 2003 21:18
Quote: "No full answers please people - teachers are getting wise to the internet, and we dont want Shady to be accused of plagarism..."


That's right, and I may add that the process of learning will be increased if he finds out himself.
But some teachers are using the internet for the cause, to see if pupils can find good informations (that's also an important skill : Beeing able to select an information if you have thousands of them*)

* that doesn't mean taking the first you find

"Begin at the beginning, and go on till you come to the end: then stop." - Lewis Carroll
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 15th Sep 2003 21:23
True - if you do find stuff on the internet you do need to write it up in your own words.


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
Shady 2005 Simpson
21
Years of Service
User Offline
Joined: 26th Aug 2003
Location: Newcastle, England
Posted: 15th Sep 2003 21:44
well could you give me a clue?

cos I haven't a clue, been trying for ages and can't figure it out.

Thanx.
Damokles
21
Years of Service
User Offline
Joined: 28th May 2003
Location: Belgium
Posted: 15th Sep 2003 21:47 Edited at: 15th Sep 2003 21:47
My clue :
There is also a simple way to do it with DarkBASIC

"Begin at the beginning, and go on till you come to the end: then stop." - Lewis Carroll
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 15th Sep 2003 22:49 Edited at: 15th Sep 2003 22:50
Well, you know that a prime number is a number that has exactly 2 factors, 1 and itself. Therefore, it would save a lot of time if you just dealt with odd numbers (and the number 2) - that halves the time spent looking for prime numbers to start with, and work from there.

Alternatively, you can use the Sieve of Eratosthenes (if you dont know what that is, look it up). Would be a bit of work writing 1000 numbers, but there you go. With a computer program it would be easy enough. And no, I'm not doing it for you.


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 16th Sep 2003 00:34
Ah, I remember doing an assignment like this. Only had to go to 100 though.(3-4 years ago though) I got enough homework already though,
but good luck.



A book? I hate book. Book is stupid.
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 16th Sep 2003 02:57
I'm learning what a prime number is Well, my class is while I finish my homework in a few minutes then fix up my PHP code I printed out before I left for school ,lol

Got a knack for finding secrets??? Jingot Racing --- A new brand of Racing --- Only from Nightwatch Studios
"hey, it's tomorrow" --- Hamish
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 16th Sep 2003 21:30
I just wrote a program to write the prime numbers from 1 to whatever to a text file. It's easy, I did it in about 5 mins.

Brains are for idiots.

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Martyn Pittuck
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 16th Sep 2003 22:14 Edited at: 16th Sep 2003 22:15
lol easy , no telling though, this is very easy

Web Design Starting from $200. Special limited offer. MSN or Email me for more information.
Shady 2005 Simpson
21
Years of Service
User Offline
Joined: 26th Aug 2003
Location: Newcastle, England
Posted: 17th Sep 2003 00:16
I think I've cracked it!, though I'm not sure, could you please tell me if this is the "quick way of doing it"?

Thanx.
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 17th Sep 2003 00:37
What do you mean you think you've cracked it? You've either solved it, or you havn't.

lol


A book? I hate book. Book is stupid.
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 17th Sep 2003 00:42
lol

Got a knack for finding secrets??? Jingot Racing --- A new brand of Racing --- Only from Nightwatch Studios
"hey, it's tomorrow" --- Hamish
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Sep 2003 00:43
And I'm afraid you haven't!

49 is most certaintly not a prime number!

Just excluding multiples of 2,3 and 5 is not enough!

Teacher will say "must try harder" and gives you D-

If your mansion house needs haunting, just call Rentaghost!
Shady 2005 Simpson
21
Years of Service
User Offline
Joined: 26th Aug 2003
Location: Newcastle, England
Posted: 17th Sep 2003 00:46
Quote: "What do you mean you think you've cracked it? You've either solved it, or you havn't."


What I meant was; was my code the quick way that my teacher was talking about or was it a really inefficient and longer than it should've been way?
Shady 2005 Simpson
21
Years of Service
User Offline
Joined: 26th Aug 2003
Location: Newcastle, England
Posted: 17th Sep 2003 00:48
ar CRAP!!

ar well time to try again
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 17th Sep 2003 01:17
Well, TCA gave a very good tip: Sieve of Eratosthenes.
And I give another one: Google.

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
Easily Confused
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 17th Sep 2003 01:28
Well, if my little test is correct (which I'm not showing you) I can tell you, you need to find 169 prime numbers between 1 and 1000.

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Sep 2003 04:20
Well I make it 168. It is common not to include '1' as a prime number.

If your mansion house needs haunting, just call Rentaghost!
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 17th Sep 2003 06:06
i've written a prime number program on my calculator, it's just a bunch of well placed for loops and some intiger tests.

Easily Confused
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 17th Sep 2003 06:34
Quote: "...It is common not to include '1' as a prime number."

(gives spooky a hard stare)
If it obeys the rules for being a prime number, then it should be included. But let's not start a debate about that here shall we

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 17th Sep 2003 06:36
Quote: "Well, TCA gave a very good tip: Sieve of Eratosthenes.
And I give another one: Google."


Clue 3: Search.

"Computers are useless they can only give you answers."
Martyn Pittuck
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 17th Sep 2003 10:32
try number tables

do a 1 - 10 accross the to and down the side and fill in the middle

Highlight all the prime numbers, is there a pattern? [hopeing the year 8 coursework is remembered properly ]

Web Design Starting from $200. Special limited offer. MSN or Email me for more information.
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 17th Sep 2003 23:45
You can most certainly do it with darkBASIC but I don't know if it counts if it's only quick because your computer can do millions of calculations per second.

Schnell, schnell, Kartoffelkopf!
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 18th Sep 2003 02:49
How would I find two numbers with a certain prime number? That is what I have and want to find on my own.

Got a knack for finding secrets??? Jingot Racing --- A new brand of Racing --- Only from Nightwatch Studios
"hey, it's tomorrow" --- Hamish

Login to post a reply

Server time is: 2024-11-23 21:20:16
Your offset time is: 2024-11-23 21:20:16