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.

Showing 1-2 of 2 results.

A112416 Next-to-most-significant binary digit of the n-th prime.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Leroy Quet, Dec 09 2005

Keywords

Comments

The length of the run of zeros pi(2^n+2^(n-1))-pi(2^n) (A095765): 1, 1, 1, 3, 4, 6, 12, 22, 38, 70, 130, 237, 441, ... and the length of the run of ones pi(2^n-1)-pi(2^n-2^(n-2)-1) (A095766): 1, 1, 1, 2, 3, 7, 11, 21, 37, 67, 125, 227, 431, ..., . - Robert G. Wilson v

Examples

			The 9th prime is 23 (in decimal), which is 10111 in binary. So a(9) = 0, the next-to-most significant binary digit of 23.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := IntegerDigits[Prime@n, 2][[2]]; Array[f, 105] (* Robert G. Wilson v *)

Formula

a(n) = floor((p(n) - 2^m)/2^(m-1)), where p(n) is the n-th prime and m = floor(log(p(n))/log(2)).

Extensions

More terms from Robert G. Wilson v, Jan 24 2006

A113858 Difference between A095765 and A095766.

Original entry on oeis.org

0, 0, 0, 1, 1, -1, 1, 1, 1, 3, 5, 10, 10, 38, 48, 85, 157, 280, 477, 900, 1540, 2894, 5464, 9762, 18132, 33450, 62364, 116657, 217500, 407235, 763246, 1432291, 2698847, 5087838, 9620802, 18210979, 34487702, 65417618, 124353014, 236558508
Offset: 1

Views

Author

Robert G. Wilson v, Jan 24 2006

Keywords

Comments

A095765: Number of primes whose binary expansion begins '10' less A095766: Number of primes whose binary expansion begins '11'.
The difference between successive runs of A112416.
A112416: a(n) = next-to-most-significant binary digit of n-th prime.

Crossrefs

Programs

  • Mathematica
    f[n_] := PrimePi[2^n + 2^(n - 1)] - PrimePi[2^n] - PrimePi[2^(n + 1)] + PrimePi[2^n + 2^(n - 1) - 1]; Array[f, 40]
Showing 1-2 of 2 results.