Page 1 of 1

Sum Some Primes

Posted: Sat Aug 20, 2011 10:23 pm
by lifthrasiir
Thank you Wolfram|Alpha.

Input: sum of Prime[i] for i=49999951..50000000
Output: 49122557320

Of course the "correct" way to solve this problem is finding a fast enough primality testing routine for nine-digit numbers. Plain sieving wouldn't help, so I'd use SPRP-based testing maybe.

Posted: Thu Mar 22, 2012 10:07 am
by magnus
http://primes.utm.edu/lists/small/millions/

is also a valid Hacker-Approach...

Posted: Sat Sep 15, 2012 8:57 pm
by Shirosan
the guy with wolfram|alpha solution won gold, so I guess silver goes to me:

http://primes.utm.edu/nthprime/index.php#nth
The 49,999,951st prime is 982,450,649
using that, I built a program using php and gmp_php library for the "gmp_nextprime" function, and summed up to 5000000th element

Posted: Fri Dec 02, 2016 7:55 pm
by Mad Mike
Neat Wolfram Alpha trick there. I just ended up grabbing a list and abusing Excel' sum functions.

Posted: Tue Jan 31, 2023 12:28 pm
by Schnapphahn
I found and used
http://compoasso.free.fr/primelistweb/p ... ine_en.php

after using https://www.dcode.fr/prime-numbers-search to find out my starting number

The rest was a tiny php summing up.

Am I a hacker now?