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!)
A095375 Total number of 1's in the binary expansions of the first n primes: summatory A014499. 12
1, 3, 5, 8, 11, 14, 16, 19, 23, 27, 32, 35, 38, 42, 47, 51, 56, 61, 64, 68, 71, 76, 80, 84, 87, 91, 96, 101, 106, 110, 117, 120, 123, 127, 131, 136, 141, 145, 150, 155, 160, 165, 172, 175, 179, 184, 189, 196, 201, 206, 211, 218, 223, 230, 232, 236, 240, 245, 249, 253 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
n=4: first 4 primes={10,11,101,111}, with a(4)=8 digits 1.
MAPLE
read("transforms") :
A095375 := proc(n)
local a;
a := 0 ;
for i from 1 to n do
a := a+wt(ithprime(i)) ;
end do:
end proc: # R. J. Mathar, Jul 13 2012
# second Maple program:
a:= proc(n) option remember; `if`(n=0, 0, a(n-1)
+add(i, i=Bits[Split](ithprime(n))))
end:
seq(a(n), n=1..100); # Alois P. Heinz, Jun 26 2021
MATHEMATICA
lib[x_] :=Count[IntegerDigits[x, 2], 1] {s=0, ta=Table[0, {256}]}; Do[s=s+lib[Prime[n]]; ta[[n]]=s, {n, 1, 256}] ta
PROG
(PARI) a(n)=my(s); forprime(p=2, prime(n), s+=hammingweight(p)); s \\ Charles R Greathouse IV, Mar 29 2013
CROSSREFS
Sequence in context: A185723 A022852 A180124 * A345979 A129260 A076829
KEYWORD
nonn,base
AUTHOR
Labos Elemer, Jun 07 2004
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 June 20 07:57 EDT 2024. Contains 373512 sequences. (Running on oeis4.)