login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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.
a(n) = A095375(n) + A345867(n) for n >= 1. - Alois P. Heinz, Jun 28 2021
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:
seq(a(n), n=0..62); # Peter Luschny, Oct 26 2019
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))))
print(aupton(62)) # Michael S. Branicky, Jun 26 2021
CROSSREFS
Cf. A004676 (primes in binary), A035100 (their number of digits), A066747 & A191232: decimals and bits of the binary Copeland-Erdős constant.
Sequence in context: A256967 A225249 A214048 * A088236 A194244 A014616
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Oct 25 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 15:18 EDT 2024. Contains 371960 sequences. (Running on oeis4.)