cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A217054 Odd number version of the prime constant (A101264 interpreted as a binary number).

Original entry on oeis.org

9, 2, 8, 3, 1, 9, 5, 9, 1, 2, 5, 9, 9, 4, 0, 4, 1, 6, 0, 6, 8, 9, 1, 0, 8, 6, 7, 3, 1, 8, 4, 7, 3, 3, 0, 6, 8, 2, 9, 1, 3, 0, 6, 7, 6, 5, 6, 1, 0, 5, 5, 3, 6, 9, 7, 5, 7, 1, 1, 2, 3, 2, 9, 8, 4, 7, 4, 6, 3, 2, 5, 8, 3, 8, 2, 8, 3, 2, 2, 1, 3, 3, 5, 6, 2, 9, 8, 4, 1, 2, 6, 9, 7, 2, 5, 6, 1
Offset: 0

Views

Author

Alonso del Arte, Sep 25 2012

Keywords

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."

Examples

			1/2 + 1/4 + 1/8 + 1/32 + 1/64 + ... = 0.928319591...
		

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.

Programs

  • Mathematica
    RealDigits[Sum[1/2^((Prime[k] - 1)/2), {k, 2, 1000}], 10, 100][[1]]
  • 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

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.