mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2010-04-07, 00:34   #34
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,343 Posts
Default

Quote:
Originally Posted by petrw1 View Post
Cool....my first 5 answers match.

Crap...I missed the next 2: Bug alert!
What program are you using? It's entirely possible the bug is in my code.
bsquared is offline   Reply With Quote
Old 2010-04-07, 00:48   #35
axn
 
axn's Avatar
 
Jun 2003

12AD16 Posts
Default

Quote:
Originally Posted by bsquared View Post
What program are you using? It's entirely possible the bug is in my code.
Pari concurs with your first seven

Code:
p=2;s=0;ten=10;for(i=2,10000000,s=s+p;if(Mod(s,ten)==0, ten=ten*10;print(i,":",p, ":",s)); p=nextprime(p+1))

4:5:10
10:23:100
3796:35677:63731000
10184:106853:515530000
51532:632501:15570900000
1926966:31190879:29057028000000
3471032:58369153:98078160000000
axn is online now   Reply With Quote
Old 2010-04-07, 01:01   #36
axn
 
axn's Avatar
 
Jun 2003

7×683 Posts
Default

While we're at it, some results for the cubes:
Code:
3:5:160
51:233:143309500
1095:8783:167992435025000
2739:24763:9495929161130000
401785:5828099:18803849605481106073200000
616801:9229931:114943299218925309364000000
14335805:262707241:62239590622437034770047320000000
axn is online now   Reply With Quote
Old 2010-04-07, 03:40   #37
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

10001011101012 Posts
Default

Quote:
Originally Posted by bsquared View Post
What program are you using? It's entirely possible the bug is in my code.
Plain, ordinary, BASIC.

My guess is I lost precision when the sum got too high.
I need to try QuadIntegers
petrw1 is offline   Reply With Quote
Old 2010-04-07, 04:46   #38
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,343 Posts
Default

Quote:
Originally Posted by axn View Post
While we're at it, some results for the cubes:
Code:
3:5:160
51:233:143309500
1095:8783:167992435025000
2739:24763:9495929161130000
401785:5828099:18803849605481106073200000
616801:9229931:114943299218925309364000000
14335805:262707241:62239590622437034770047320000000
Doublecheck plus a few more:
Code:
**** 10 divides prime cube sum up to 5, sum = 160 ****
**** 100 divides prime cube sum up to 233, sum = 143309500 ****
**** 1000 divides prime cube sum up to 8783, sum = 167992435025000 ****
**** 10000 divides prime cube sum up to 24763, sum = 9495929161130000 ****
**** 100000 divides prime cube sum up to 5828099, sum = 18803849605481106073200000 ****
**** 1000000 divides prime cube sum up to 9229931, sum = 114943299218925309364000000 ****
**** 10000000 divides prime cube sum up to 262707241, sum = 62239590622437034770047320000000 ****
**** 100000000 divides prime cube sum up to 7717488553, sum is 39389391603365585735745579849700000000 ****
**** 1000000000 divides prime cube sum up to 34529828929, sum = 14800565770732540706707662233175000000000 ****
**** 10000000000 divides prime cube sum up to 311995561321, sum = 90365528187658782254536155073531290000000000 ****
By morning the search should be at (all primes below) 10 trillion.
bsquared is offline   Reply With Quote
Old 2010-04-07, 14:08   #39
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,343 Posts
Default

Quote:
Originally Posted by bsquared View Post
By morning the search should be at (all primes below) 10 trillion.
Done. Here's the 11th term:

Code:
**** 100000000000 divides prime cube sum up to 549120448879, sum is 848814744633978332442418792098769600000000000 ****
I updated my webpage too.
bsquared is offline   Reply With Quote
Old 2010-04-07, 14:17   #40
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

D0F16 Posts
Default

Quote:
Originally Posted by petrw1 View Post
Plain, ordinary, BASIC.

My guess is I lost precision when the sum got too high.
I need to try QuadIntegers
Yes, that could be the issue. I'm using 3 64 bit words to hold the sum, which may not even be big enough for the cube sum problem eventually. 192 bits can hold a 58 digit number without loss of precision and the cube sum up to 10 trillion is already at 49 digits.

A single 64 bit integer runs out of precision at about 1.8e19, which is enough for the prime sum up to about 9 billion. Since you found the point at (632501 15570900000), you must be using more than 32 bits... but with 64 bits you should be fine for a few more points of the sequence. So maybe its an issue with your prime generation as well. A useful double check is to see if the count of primes you've summed agrees with known prime counts. For instance here.

Last fiddled with by bsquared on 2010-04-07 at 14:18
bsquared is offline   Reply With Quote
Old 2010-04-07, 17:34   #41
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

446910 Posts
Default YUP- precision.

Quote:
Originally Posted by petrw1 View Post
Plain, ordinary, BASIC.

My guess is I lost precision when the sum got too high.
I need to try QuadIntegers
I can match the first 7 now.

I used canned/downloaded lists of Primes.

Takes about 5 seconds.
petrw1 is offline   Reply With Quote
Old 2010-04-08, 14:28   #42
davar55
 
davar55's Avatar
 
May 2004
New York City

101468 Posts
Default

Another way to extend this problem is to use
a base other than ten. I think binary.

2^2 + 3^2 + 5^2 + ... + p^2 = 2mK

What is the smallest prime p such that
the sum of squares of all primes up to p
is a multiple of 2 (or 4 or 8 or 16 or ...).

This question can also be asked of first powers
or cubes of primes.

Since we basically compute in decimal or binary,
if there's an interesting number theoretic fact here
we may find it in one of these two related
sequences of sequences.
davar55 is offline   Reply With Quote
Old 2010-04-08, 14:55   #43
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

22·3·599 Posts
Default

Quote:
Originally Posted by cheesehead View Post
Oh, wow ... bases 2-16 or so, powers to, say, ninth ==> 135 sequences.
...
cheesehead is offline   Reply With Quote
Old 2010-04-10, 01:35   #44
alexhiggins732
 
Mar 2010
Brick, NJ

67 Posts
Default

Quote:
Originally Posted by bsquared View Post
Done. Here's the 11th term:

Code:
**** 100000000000 divides prime cube sum up to 549120448879, sum is 848814744633978332442418792098769600000000000 ****
I updated my webpage too.
n Pmax Sum(P^2) from 2 to Pmax; a multiple of 10^n
1 907 37464550
2
977 46403000
3
977 46403000

You have duplicated 2 and 3 on your site. I also noted that the OEIS sequence didn't have example code. Perhaps you could submit the expression you have entered into YAFU.

Last fiddled with by alexhiggins732 on 2010-04-10 at 01:35 Reason: Table HTML was stripped...
alexhiggins732 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 08:18.

Mon Nov 30 08:18:03 UTC 2020 up 81 days, 5:29, 3 users, load averages: 0.71, 1.13, 1.26

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.