![]() |
![]() |
#23 | |
Aug 2006
10111010101102 Posts |
![]() Quote:
76304519151822049179, 671924965564646162227, 2393465488665494654963, 5889405149040404480379, 11834774513923727795971, 20925456417823033330259, ... |
|
![]() |
![]() |
![]() |
#24 | |
"Ben"
Feb 2007
D2B16 Posts |
![]() Quote:
I also store the highest power of 2 dividing the power of 10 modulus, which makes for a very quick pre-test 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. |
|
![]() |
![]() |
![]() |
#25 |
"Ben"
Feb 2007
3,371 Posts |
![]() |
![]() |
![]() |
![]() |
#26 |
"Ben"
Feb 2007
3,371 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 |
![]() |
![]() |
![]() |
#27 |
May 2004
New York City
23·232 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. |
![]() |
![]() |
![]() |
#28 |
Aug 2006
2·29·103 Posts |
![]() |
![]() |
![]() |
![]() |
#30 |
May 2004
New York City
10000100010002 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 = 10mK 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. |
![]() |
![]() |
![]() |
#31 | |
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
2×32×11×23 Posts |
![]() Quote:
5 10 23 100 35677 63731000 106853 515530000 632501 15570900000 Last fiddled with by petrw1 on 2010-04-06 at 22:40 Reason: 6M |
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
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 |