2006-09-20, 12:26 | #1 |
Jun 2005
142_{8} Posts |
Sum of all integer digits of all primes between 1 an n
With the discovery of M44 (congratulations GIMPS) I pondered over the thought if it is possible to count/calculate all the ones of all the primes between 2 and M44. It is a bit off-topic but the result is interesting.
To calculate or estimate the number of ones, I set about as follows. Define as the sum of all base-b integer digits between 1 and n and can be expressed as. Above has the spot values Now assume to be large then and proportioning to the number of primes between and which is approximated in the Prime Number Theorem as we obtain the unexpected result that the cumulative sum of all base-b integer digits of all the primes between and prime approximates to Conjecture The ratio defined as "the sum of all base-b digits of all the primes between 1 and n" to "n", converges to the constant for increasing n. and A computation check confirms above tendency already at relatively small values of n. Is above already known or have I introduced a new constant? In parctice how will the constant depart from above definition? Regards Anton Vrba |
2006-09-20, 12:34 | #2 |
Jun 2005
62_{16} Posts |
For the Mathematica users
Code:
CumSumDigits[n_, b_] := Module[ {ss, p, d0, d1, m} , ss = p = d0 = 0 ; m = n ; While[m > 0, { If[(d1 = Mod[m, b]) != 0, { ss += d1( b^p(b - 1) p + b^p (d1 - 1) + 2(d0 + 1))/2, d0 += b^p d1}], p += 1, m = IntegerPart[m/b], }] ; Return [ss ] ; ] Code:
CumSumDigits[(10^123 - 1)/9, 10] - CumSumDigits[(10^123 - 1)/9 - 1, 10] |
2006-09-20, 17:20 | #3 |
Jun 2005
1100010_{2} Posts |
here is a base-10 evaluation of counting up to
Code:
Prime Actual Calculated Actual/Calculated 99999989 2.09217 2.07412 1.0087 999999937 2.07641 2.05933 1.0083 9999999967 2.06389 2.00702 1.0078 99999999977 2.05366 2.03844 1.00747 Calculated value being the prime counting function An on the same basis a base-2 evaluation for Code:
32749 0.845614 0.804225 1.05146 65521 0.837533 0.798769 1.04853 131071 0.832198 0.794553 1.04738 262139 0.825139 0.789684 1.0449 524287 0.820511 0.78624 1.04359 1048573 0.815104 0.782262 1.04198 2097143 0.810823 0.779118 1.04069 4194301 0.806539 0.776155 1.03915 8388593 0.802665 0.773417 1.03782 16777213 0.798989 0.770954 1.03636 33554393 0.795861 0.768785 1.03522 67108859 0.792815 0.766688 1.03408 134217689 0.790022 0.764787 1.033 268435399 0.787444 0.763058 1.03196 536870909 0.785043 0.76144 1.031 1073741789 0.782845 0.75996 1.03011 2147483647 0.780761 0.758568 1.02926 Last fiddled with by AntonVrba on 2006-09-20 at 18:11 |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
k*b^n+/-c where b is an integer greater than 2 and c is an integer from 1 to b-1 | jasong | Miscellaneous Math | 5 | 2016-04-24 03:40 |
All top 5000 primes will have the same number of digits in 2014 ;-) | Batalov | Conjectures 'R Us | 10 | 2013-03-29 01:29 |
Always an integer. | mfgoode | Puzzles | 18 | 2007-07-13 18:03 |
get all the 5000 biggest primes above 100K digits | jasong | jasong | 1 | 2007-06-09 22:51 |
Primes for a mersenne integer DWT FNT | gbvalor | Math | 1 | 2003-09-08 16:05 |