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.

A086904 Write the primes in binary; a(n) = total number of 0's in those which have an n-bit expansion.

Original entry on oeis.org

1, 1, 2, 7, 13, 35, 71, 147, 298, 622, 1270, 2558, 5257, 10509, 21297, 42852, 86258, 173528, 348187, 699590, 1404936, 2818606, 5657411, 11345622, 22746823, 45605127, 91421299, 183206338, 367111951, 735525895, 1473503602, 2951661316, 5911864292, 11840082252
Offset: 2

Views

Author

Jacob Woolcutt (woolcutt(AT)uiuc.edu), Sep 19 2003

Keywords

Examples

			a(2) = 1: 2 = 10 and 3 = 11, with a total of one 0.
a(3) = 1: 5 = 101, 7 = 111, again with just one 0.
		

Crossrefs

Cf. A168156.

Programs

  • Mathematica
    a[n_] := Sum[If[PrimeQ[k], DigitCount[k, 2, 0], 0], {k, 2^(n - 1), 2^n - 1}]; Array[a, 20, 2] (* Amiram Eldar, Jan 11 2020 *)
  • PARI
    a(n) = {nb = 0; for (i=2^(n-1), 2^n-1, if (isprime(i), nb += n - norml2(binary(i)));); return (nb);} \\ Michel Marcus, Jun 20 2013

Extensions

a(27)-a(35) from Amiram Eldar, Jan 11 2020