login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A168156 Sum of the binary digits of all primes between 2^(n-1) and 2^n-1, i.e., with exactly n binary digits. 2
0, 3, 5, 6, 18, 29, 56, 113, 240, 452, 885, 1790, 3474, 6951, 13671, 27183, 54201, 107224, 213882, 424513, 845716, 1682456, 3350362, 6671581, 13299828, 26500297, 52829961, 105342821, 210088965, 419106389, 836097752, 1668341390 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Sequence A168155 yields the partial sums.

LINKS

Table of n, a(n) for n=1..32.

EXAMPLE

No prime can be written with only 1 binary digit, thus a(1)=0.

The primes that can be written with 2 binary digits are 2 = 10[2] and 3 = 11[2], they have 3 nonzero bits, so a(2)=3.

Primes with 3 binary digits are 5 = 101[2] and 7 = 111[3]. They have a total of a(3)=5 nonzero bits.

PROG

(PARI) s=0; L=p=2; while( L*=2, print1(s", "); s=0; until( L<p=nextprime(p+1), s+=norml2(binary(p))))

CROSSREFS

Cf. A086904.

Sequence in context: A192119 A050563 A282809 * A295403 A272440 A276704

Adjacent sequences:  A168153 A168154 A168155 * A168157 A168158 A168159

KEYWORD

nonn

AUTHOR

M. F. Hasler, Nov 20 2009

EXTENSIONS

a(26)-a(32) from Donovan Johnson, Jul 28 2010

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 18 10:35 EDT 2019. Contains 325138 sequences. (Running on oeis4.)