mersenneforum.org Sums of all Squares
 Register FAQ Search Today's Posts Mark Forums Read

 2010-03-18, 14:00 #1 davar55     May 2004 New York City 423210 Posts Sums of all Squares 2^2 + 3^2 + 5^2 + ... + p^2 = 10mK What is the smallest prime p such that the sum of squares of all primes up to p is a multiple of 10 (or 100 or 1000).
 2010-03-18, 14:26 #2 axn     Jun 2003 24×307 Posts s=0;forprime(p=2,1000,s=s+p^2;if(Mod(s,10)==0, print(p, ":",s))) 907:37464550 967:44505630 977:46403000 991:48351370
 2010-03-18, 14:32 #3 davar55     May 2004 New York City 23·232 Posts Nice and simple and quick reply -- thanks. I won't ask about extending the list to 10000, etc. .....
 2010-03-18, 17:11 #4 CRGreathouse     Aug 2006 32×5×7×19 Posts 907, 977, 977, 36643, 1067749, 17777197, 71622461, 2389799983, ... The next term (if one exists) is more than 4 trillion. Last fiddled with by CRGreathouse on 2010-03-18 at 17:20
2010-03-18, 18:16   #5

"Richard B. Woods"
Aug 2002
Wisconsin USA

22×3×641 Posts

Not yet in the OEIS.

http://www.research.att.com/~njas/sequences/

Quote:
 Search: 907, [B] 967, 977, 991[/B] I am sorry, but the terms do not match anything in the table. If your sequence is of general interest, please send it to me using the form provided and I will (probably) add it to the data base! Include a brief description and if possible enough terms to fill 3 lines on the screen. I need a minimum of 4 terms.
I think it qualifies. Also, I'm fond of OEIS entries with relatively large initial terms -- especially when the next few terms are so closely spaced as in this one. (Might it set some record in that regard -- highest ratio of initial term to average spacing of next n terms, for n = 3?)

I'd be glad to submit it, but I think it should be one of you guys.

How about generalizing to other bases?

Last fiddled with by cheesehead on 2010-03-18 at 18:34

2010-03-18, 19:02   #6
axn

Jun 2003

24×307 Posts

Quote:
 Originally Posted by cheesehead Not yet in the OEIS.
I think CRG's sequence is more "worthy". It is also the solution of OP.

Quote:
I can think of two ways to generalize: to other bases and other powers (other than squares).

2010-03-18, 19:50   #7

"Richard B. Woods"
Aug 2002
Wisconsin USA

1E0C16 Posts

Quote:
 Originally Posted by axn I think CRG's sequence is more "worthy".
Even with the omitted and repeated (just a typo) terms? :smile:

What I had in mind was a submission with the best of both your contributions.

Quote:
 I can think of two ways to generalize: to other bases and other powers (other than squares).
Oh, wow ... bases 2-16 or so, powers to, say, ninth ==> 135 sequences.

Last fiddled with by cheesehead on 2010-03-18 at 19:56

2010-03-18, 19:59   #8
axn

Jun 2003

491210 Posts

Quote:
 Originally Posted by cheesehead Even with the omitted and repeated terms?
That sequence is the first occurrence of 10^n. 977 repeats (not a typo!) because it ends in 000 and comes before any other 00. So it stands at positions 2 & 3.

EDIT:- Mine is merely the first four occurrences of 10

Last fiddled with by axn on 2010-03-18 at 20:02

2010-03-18, 20:02   #9

"Richard B. Woods"
Aug 2002
Wisconsin USA

11110000011002 Posts

Quote:
 Originally Posted by axn That sequence is the first occurrence of 10^n. 977 repeats because it ends in 000 and comes before any other 00. So it stands at positions 2 & 3.

(Sorry, CRG)

But that doubles the potential number of sequences. 270.

Last fiddled with by cheesehead on 2010-03-18 at 20:04

2010-03-19, 01:28   #10
CRGreathouse

Aug 2006

598510 Posts

Quote:
 Originally Posted by CRGreathouse The next term (if one exists) is more than 4 trillion.
That's *billion*, not trillion. Now my search limit is 50 billion, giving me

907, 977, 977, 36643, 1067749, 17777197, 71622461, 2389799983, 31252968359, 49460594569, ...

The nth term is very roughly n * log 10 * 10^n, so I was pretty lucky getting that last term. The next one will probably need over 2 trillion. Anyone up to the task? I don't actually have a good segmented sieve coded at the moment...

2010-03-29, 16:42   #11
bsquared

"Ben"
Feb 2007

22·23·37 Posts

Quote:
 Originally Posted by CRGreathouse Anyone up to the task? I don't actually have a good segmented sieve coded at the moment...
I bit.

I have recently spent some time with my sieve, so decided to give this a shot.

I just started a run to 2 trillion. Here is the output so far:
Code:
found primes in range 0 to 1000000000 in elapsed time = 7.0227
**** 907 is 0 mod 10 ****
**** 977 is 0 mod 100 ****
**** 977 is 0 mod 1000 ****
**** 36643 is 0 mod 10000 ****
**** 1067749 is 0 mod 100000 ****
**** 17777197 is 0 mod 1000000 ****
**** 71622461 is 0 mod 10000000 ****
sum of squares complete in elapsed time = 8.5178, sum is 16352255694497179054764665

found primes in range 1000000000 to 2000000000 in elapsed time = 5.9418
sum of squares complete in elapsed time = 7.9423, sum is 126512354351558021982865866

found primes in range 2000000000 to 3000000000 in elapsed time = 5.9503
**** 2389799983 is 0 mod 100000000 ****
sum of squares complete in elapsed time = 7.7389, sum is 418923904898718760122282892

found primes in range 3000000000 to 4000000000 in elapsed time = 5.8990
sum of squares complete in elapsed time = 7.6150, sum is 979895993641271252685833855

found primes in range 4000000000 to 5000000000 in elapsed time = 5.8293
sum of squares complete in elapsed time = 7.4966, sum is 1894402266333772221759233898
With these timing trends, should have a result in 7 hours or so.

- ben.

 Similar Threads Thread Thread Starter Forum Replies Last Post a1call Miscellaneous Math 42 2017-02-03 01:29 Nick Number Theory Discussion Group 0 2016-12-11 11:30 3.14159 Miscellaneous Math 12 2010-07-21 11:47 CRGreathouse Math 6 2009-11-06 19:20 m_f_h Puzzles 45 2007-06-15 17:46

All times are UTC. The time now is 06:09.

Thu Apr 15 06:09:41 UTC 2021 up 7 days, 50 mins, 0 users, load averages: 2.25, 1.95, 1.77