|
|
A328659
|
|
Partial sums of A035100: number of binary digits of the primes.
|
|
3
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Useful to express the binary Copeland-Erdős constant, cf. formula.
Plotting a(n) against prime(n) might be a good tool for introducing students of mathematics, particularly those who are familiar with the use of binary representation, to the way the density of prime numbers decreases with increasing size. In essence, the graph of a(n) against prime(n) is approximately linear, and this becomes more obvious if we plot a(n)/prime(n): see the relevant plot in the links. - Peter Munn, Mar 03 2024
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n + Sum_{k=1..n} floor(log_2(prime(k))).
A066747 = Sum_{n >= 1} prime(n)/2^a(n), the binary Copeland-Erdős constant.
a(n) = a(n-1) + A035100(n), n >= 1.
|
|
EXAMPLE
|
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.
|
|
MAPLE
|
a := n -> add(ilog2(ithprime(k)), k=1..n) + n:
|
|
MATHEMATICA
|
Join[{0}, Accumulate[BitLength[Prime[Range[100]]]]] (* Paolo Xausa, Mar 20 2024 *)
|
|
PROG
|
(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))))
|
|
CROSSREFS
|
Cf. A004676 (primes in binary), A035100 (their number of digits), A066747 & A191232: decimals and bits of the binary Copeland-Erdős constant.
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|