A328659 Partial sums of A035100: number of binary digits of the primes.
0, 2, 4, 7, 10, 14, 18, 23, 28, 33, 38, 43, 49, 55, 61, 67, 73, 79, 85, 92, 99, 106, 113, 120, 127, 134, 141, 148, 155, 162, 169, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, 272, 280, 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 369, 378, 387, 396, 405, 414, 423, 432
Offset: 0
Examples
Primes written in binary (A004676) read: 10, 11, 101, 111, 1011, 1101, 10001, ... The length of the concatenation of the first n = 0, 1, 2, 3, .... terms is 0, 2, 4, 7, 10, 14, 18, 23, ...: this sequence.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
- Peter Munn, Plot2 graph of a(n)/prime(n)
Crossrefs
Programs
-
Maple
a := n -> add(ilog2(ithprime(k)), k=1..n) + n: seq(a(n), n=0..62); # Peter Luschny, Oct 26 2019
-
Mathematica
Join[{0}, Accumulate[BitLength[Prime[Range[100]]]]] (* Paolo Xausa, Mar 20 2024 *)
-
PARI
s=0; A328659=vector(50,n,s+=logint(prime(n),2)+1)
-
Python
from sympy import prime, primerange as primes from itertools import accumulate def f(n): return len(bin(n)[2:]) def aupton(nn): return [0]+list(accumulate(map(f, primes(2, prime(nn)+1)))) print(aupton(62)) # Michael S. Branicky, Jun 26 2021
Comments