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.

A328659 Partial sums of A035100: number of binary digits of the primes.

This page as a plain text file.
%I A328659 #46 Mar 21 2024 16:32:38
%S A328659 0,2,4,7,10,14,18,23,28,33,38,43,49,55,61,67,73,79,85,92,99,106,113,
%T A328659 120,127,134,141,148,155,162,169,176,184,192,200,208,216,224,232,240,
%U A328659 248,256,264,272,280,288,296,304,312,320,328,336,344,352,360,369,378,387,396,405,414,423,432
%N A328659 Partial sums of A035100: number of binary digits of the primes.
%C A328659 Useful to express the binary Copeland-Erdős constant, cf. formula.
%C A328659 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
%H A328659 Robert Israel, <a href="/A328659/b328659.txt">Table of n, a(n) for n = 0..10000</a>
%H A328659 Peter Munn, <a href="https://oeis.org/plot2a?name1=A328659&amp;name2=A000040&amp;tform1=untransformed&amp;tform2=untransformed&amp;shift=0&amp;radiop1=ratio&amp;drawlines=true">Plot2 graph of a(n)/prime(n)</a>
%F A328659 a(n) = n + Sum_{k=1..n} floor(log_2(prime(k))).
%F A328659 A066747 = Sum_{n >= 1} prime(n)/2^a(n), the binary Copeland-Erdős constant.
%F A328659 a(n) = a(n-1) + A035100(n), n >= 1.
%F A328659 a(n) = A095375(n) + A345867(n) for n >= 1. - _Alois P. Heinz_, Jun 28 2021
%e A328659 Primes written in binary (A004676) read: 10, 11, 101, 111, 1011, 1101, 10001, ...
%e A328659 The length of the concatenation of the first n = 0, 1, 2, 3, .... terms is
%e A328659   0, 2, 4, 7, 10, 14, 18, 23, ...: this sequence.
%p A328659 a := n -> add(ilog2(ithprime(k)), k=1..n) + n:
%p A328659 seq(a(n), n=0..62); # _Peter Luschny_, Oct 26 2019
%t A328659 Join[{0}, Accumulate[BitLength[Prime[Range[100]]]]] (* _Paolo Xausa_, Mar 20 2024 *)
%o A328659 (PARI) s=0; A328659=vector(50,n,s+=logint(prime(n),2)+1)
%o A328659 (Python)
%o A328659 from sympy import prime, primerange as primes
%o A328659 from itertools import accumulate
%o A328659 def f(n): return len(bin(n)[2:])
%o A328659 def aupton(nn): return [0]+list(accumulate(map(f, primes(2, prime(nn)+1))))
%o A328659 print(aupton(62)) # _Michael S. Branicky_, Jun 26 2021
%Y A328659 Cf. A004676 (primes in binary), A035100 (their number of digits), A066747 & A191232: decimals and bits of the binary Copeland-Erdős constant.
%Y A328659 Cf. A095375, A345867.
%K A328659 nonn,base
%O A328659 0,2
%A A328659 _M. F. Hasler_, Oct 25 2019