%I #5 Mar 30 2012 17:22:56
%S 1,1,1,1,2,1,1,2,3,0,1,3,4,2,1,1,3,6,4,4,0,1,3,9,9,8,0,1,1,3,12,13,20,
%T 0,5,0,1,4,12,23,31,8,14,4,0,1,4,16,29,48,24,38,9,3,0,1,4,18,42,73,52,
%U 72,29,17,1,0,1,4,21,53,111,80,151,81,52,5,5,0,1,4,23,62,152,158,256,186
%N Triangle in which row n gives the number of primes <= 2^n having k 1's in their binary representation, k=1..n.
%C Every row begins with 1 because 2 is the only prime having one 1 in its binary representation. A row ends in 1 or 0, depending on whether 2^n-1 is prime or composite. The sum of terms in row n is A007053(n).
%H T. D. Noe, <a href="/A177858/b177858.txt">Rows n=1..30, flattened</a>
%t nn=20; cnt=Table[0,{nn}]; Flatten[Table[Do[p=Prime[i]; c=Total[IntegerDigits[p,2]]; cnt[[c]]++, {i, 1+PrimePi[2^(n-1)], PrimePi[2^n]}]; Take[cnt,n], {n,nn}]]
%Y Cf. A061712 (least prime having n 1's)
%K nonn,tabl
%O 1,5
%A _T. D. Noe_, May 14 2010
|