20100330, 17:27  #23  
Aug 2006
13445_{8} Posts 
Quote:
76304519151822049179, 671924965564646162227, 2393465488665494654963, 5889405149040404480379, 11834774513923727795971, 20925456417823033330259, ... 

20100330, 19:00  #24  
"Ben"
Feb 2007
2×5×7×47 Posts 
Quote:
I also store the highest power of 2 dividing the power of 10 modulus, which makes for a very quick pretest of divisibility by 10 (logical AND followed by a predictable branch) and makes full precision divisions *extremely* rare. Doing things this way is actually faster than using pure modular arithmetic, since we almost never have to perform a division. As a side benefit, it's easy to build tables of prime sums, or prime square sums, and we also don't have to restart a sum to test for a new power of 10 modulus. 

20100330, 19:02  #25 
"Ben"
Feb 2007
2·5·7·47 Posts 

20100330, 19:43  #26 
"Ben"
Feb 2007
2·5·7·47 Posts 
I must have some sort of tinkerers disease... can't leave well enough alone.
This disease was causing me to be offended by how long it was taking to compute the primes in a range of 1e9. So I tinkered... and doubled the speed before: Code:
found 40609038 primes in range 49000000000 to 50000000000 in elapsed time = 5.4835 **** 49460594569 is 0 mod 1410065408 **** sum of squares complete in elapsed time = 6.8852, sum is 1714863031171407826702942323341 Code:
found 40609038 primes in range 49000000000 to 50000000000 in elapsed time = 2.8866 **** 49460594569 is 0 mod 10000000000 **** sum of squares complete in elapsed time = 0.1639, sum is 1714863031171407826702942323341 
20100330, 20:00  #27 
May 2004
New York City
2·3^{2}·5·47 Posts 
This is fine work by all of you. If you wish to submit the sequence to
oeis, please go ahead. I couldn't do justice to the calculations, which I'm really impressed by. Joint discovery (attribution) is fine. 
20100330, 20:14  #28 
Aug 2006
1011100100101_{2} Posts 

20100406, 20:28  #30 
May 2004
New York City
4230_{10} Posts 
With all the work done on the OP, it shouldn't be too hard
to generalize the problem a bit. I think cubes. 2^3 + 3^3 + 5^3 + ... + p^3 = 10^{m}K What is the smallest prime p such that the sum of cubes of all primes up to p is a multiple of 10 (or 100 or 1000 or 10000 or ...). I'm also curious about how these (squares and cubes) results compare to first powers (sum of primes themselves). Since these series depend on the properties of a number in base ten, they could be considered recreational  interesting but not necessarily useful. Still, perhaps the sequence of sequences can someday be used to derive some important number theoretic fact. That's one of the purposes of the oeis. 
20100406, 22:33  #31  
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
41·107 Posts 
Quote:
5 10 23 100 35677 63731000 106853 515530000 632501 15570900000 Last fiddled with by petrw1 on 20100406 at 22:40 Reason: 6M 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Regarding Squares  a1call  Miscellaneous Math  42  20170203 01:29 
Basic Number Theory 12: sums of two squares  Nick  Number Theory Discussion Group  0  20161211 11:30 
Integers = sums of 2s and 3s.  3.14159  Miscellaneous Math  12  20100721 11:47 
Sums of three squares  CRGreathouse  Math  6  20091106 19:20 
squares or not squares  m_f_h  Puzzles  45  20070615 17:46 