|
-
Jun 29th, 2004, 11:17 PM
#1
Thread Starter
Fanatic Member
Well, that was fun
I just found some programming test asking me to prove if the any even number between 6 and a million is equal to the sum of two prime numbers.
Well, it's running right now. Outputting to a file. This is the first prime number making proggy I've done so hopefully it works.
...The file is now at 19k. and the last number is 28019. Make that 20k...
Go compy go! Almost 1% done! (It'll slow done more as it approaches a million, right?) Then of course it needs to compare...
I didn't optimize this code at all. It actually just creates an array of prime numbers and loops through them ALL (^2 since it needs a subloop!)
Crazy ol me
Don't pay attention to this signature, it's contradictory.
-
Jun 29th, 2004, 11:45 PM
#2
How are you generating the primes?
-
Jun 30th, 2004, 12:44 AM
#3
Hyperactive Member
There will be 42.
It's been proven many times before ...
Rate my response if I helped
Go Hard Or Go Home
-
Jun 30th, 2004, 08:35 AM
#4
Lively Member
Originally posted by Gary Campbell
There will be 42.
It's been proven many times before ...
thanks for ruining the surprise...
Last edited by Xcoder : 09-10-2001 at 12:45 AM.
-
Jun 30th, 2004, 05:20 PM
#5
-
Jun 30th, 2004, 05:28 PM
#6
Hyperactive Member
So what's the answer?
I'll use it as a multiplier on the next software project I quote on ...
Rate my response if I helped
Go Hard Or Go Home
-
Jun 30th, 2004, 06:52 PM
#7
Thread Starter
Fanatic Member
I had it calculate up to about 100000 before I went to bed. So far the answer is true (there have been tests up to 4*10^14 (maybe higher)).
I'm generating the primes by creating a list of primes and comparing new numbers against it.
Basicly, start a dynamic array with 1 element containing 2. Check 3, sesize, put 3 in. Check 5, resize... check 9, 9 is divisible by 3.., don't resize... etc
BTW, my "incredibly" advanced formula is "If int(x/y) = x/y then it aint no prime"
Don't pay attention to this signature, it's contradictory.
-
Jun 30th, 2004, 08:42 PM
#8
Great. Your next task is to find the 42nd Mersenne (sp?) prime.
If [2n-1] is prime, then it is Mersenne.
-
Jun 30th, 2004, 11:56 PM
#9
Thread Starter
Fanatic Member
Don't pay attention to this signature, it's contradictory.
-
Jul 1st, 2004, 12:43 AM
#10
Hyperactive Member
Great. What do I use to quote with now? I've been hanging on that number for days ...
Rate my response if I helped
Go Hard Or Go Home
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|