Results 1 to 10 of 10

Thread: Well, that was fun

  1. #1

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    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.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    How are you generating the primes?

  3. #3
    Hyperactive Member Foxer's Avatar
    Join Date
    Oct 2001
    Location
    Australia
    Posts
    278
    There will be 42.

    It's been proven many times before ...
    Rate my response if I helped

    Go Hard Or Go Home


  4. #4
    Lively Member Xcoder's Avatar
    Join Date
    Jan 2004
    Posts
    120
    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.

  5. #5
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Re: Well, that was fun

    Originally posted by alkatran
    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.

    3 + 5 = 8
    Proof that there exists an even number between 6 and a million that is the sum of 2 prime numbers.

    You can can your progie now.



    -Lou

  6. #6
    Hyperactive Member Foxer's Avatar
    Join Date
    Oct 2001
    Location
    Australia
    Posts
    278
    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


  7. #7

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    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.

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Great. Your next task is to find the 42nd Mersenne (sp?) prime.

    If [2n-1] is prime, then it is Mersenne.

  9. #9

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    Error: Overflow
    Don't pay attention to this signature, it's contradictory.

  10. #10
    Hyperactive Member Foxer's Avatar
    Join Date
    Oct 2001
    Location
    Australia
    Posts
    278


    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
  •  



Click Here to Expand Forum to Full Width