OFFSET
0,1
COMMENTS
The prime constant (A051006) is essentially a set of flags that tell us whether a given integer is prime. But since all even numbers (except 2) are composite, every other bit is guaranteed to be 0.
Depending on the algorithm for which this is used, it may be more efficient to store a set of flags for just the odd numbers (and handle 2 as a special case). Lehmer (1969) suggests using about 64 kilobytes for the storage of this "characteristic number."
REFERENCES
D. H. Lehmer, "Computer Technology Applied to the Theory of Numbers," from Studies in Number Theory, ed. William J. LeVeque. Englewood Cliffs, New Jersey: Prentice Hall (1969): 138.
FORMULA
sum(k = 1 .. infinity, chi(2k + 1)/2^k), where chi(n) is the characteristic function of the prime numbers (A010051).
sum(k = 2 .. infinity, 1/2^((p(k) - 1)/2)), where p(k) is the k-th prime number.
EXAMPLE
1/2 + 1/4 + 1/8 + 1/32 + 1/64 + ... = 0.928319591...
MATHEMATICA
RealDigits[Sum[1/2^((Prime[k] - 1)/2), {k, 2, 1000}], 10, 100][[1]]
PROG
(PARI) s=0; forprime(p=3, default(realprecision)*log(100)\log(2)+9, s += 1.>>(p\2)); s \\ Charles R Greathouse IV, Sep 26 2012
CROSSREFS
KEYWORD
nonn,cons
AUTHOR
Alonso del Arte, Sep 25 2012
STATUS
approved