mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2010-03-18, 14:00   #1
davar55
 
davar55's Avatar
 
May 2004
New York City

2×2,099 Posts
Default 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).
davar55 is offline   Reply With Quote
Old 2010-03-18, 14:26   #2
axn
 
axn's Avatar
 
Jun 2003

7·683 Posts
Default

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
axn is offline   Reply With Quote
Old 2010-03-18, 14:32   #3
davar55
 
davar55's Avatar
 
May 2004
New York City

2×2,099 Posts
Default

Nice and simple and quick reply -- thanks.

I won't ask about extending the list to 10000, etc. .....
davar55 is offline   Reply With Quote
Old 2010-03-18, 17:11   #4
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

2·2,969 Posts
Default

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
CRGreathouse is offline   Reply With Quote
Old 2010-03-18, 18:16   #5
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

1C1416 Posts
Default

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
cheesehead is offline   Reply With Quote
Old 2010-03-18, 19:02   #6
axn
 
axn's Avatar
 
Jun 2003

112558 Posts
Default

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

Quote:
Originally Posted by cheesehead View Post
How about generalizing to other bases?
I can think of two ways to generalize: to other bases and other powers (other than squares).
axn is offline   Reply With Quote
Old 2010-03-18, 19:50   #7
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

22×3×599 Posts
Default

Quote:
Originally Posted by axn View Post
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
cheesehead is offline   Reply With Quote
Old 2010-03-18, 19:59   #8
axn
 
axn's Avatar
 
Jun 2003

7×683 Posts
Default

Quote:
Originally Posted by cheesehead View Post
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
axn is offline   Reply With Quote
Old 2010-03-18, 20:02   #9
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

22×3×599 Posts
Default

Quote:
Originally Posted by axn View Post
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
cheesehead is offline   Reply With Quote
Old 2010-03-19, 01:28   #10
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

173216 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
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...
CRGreathouse is offline   Reply With Quote
Old 2010-03-29, 16:42   #11
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

334210 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
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.
bsquared is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding Squares a1call Miscellaneous Math 42 2017-02-03 01:29
Basic Number Theory 12: sums of two squares Nick Number Theory Discussion Group 0 2016-12-11 11:30
Integers = sums of 2s and 3s. 3.14159 Miscellaneous Math 12 2010-07-21 11:47
Sums of three squares CRGreathouse Math 6 2009-11-06 19:20
squares or not squares m_f_h Puzzles 45 2007-06-15 17:46

All times are UTC. The time now is 11:11.

Sun Nov 29 11:11:00 UTC 2020 up 80 days, 8:21, 3 users, load averages: 1.20, 1.06, 1.06

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.