A110202 a(n) = sum of squares of numbers < 2^n having exactly 2 ones in their binary representation.
0, 9, 70, 395, 1984, 9429, 43434, 196095, 872788, 3842729, 16773118, 72693075, 313158312, 1342144509, 5726557522, 24338016935, 103078952956, 435222828369, 1832518331046, 7696579297275, 32252336887120, 134873417951909
Offset: 1
Keywords
Examples
For n=4, the sum of the squares of numbers < 2^4 having exactly 2 ones in their binary digits is: a(4) = 3^2 + 5^2 + 6^2 + 9^2 + 10^2 + 12^2 = 395.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Crossrefs
Programs
-
Mathematica
nn=30;With[{c=Union[FromDigits[#,2]&/@(Flatten[Table[Join[ {1},#]&/@ Permutations[Join[{1},PadRight[{},n,0]]],{n,0,nn}],1])]}, Table[ Total[ Select[c,#<2^n&]^2],{n,nn}]] (* Harvey P. Dale, Jan 27 2013 *)
-
PARI
a(n)=polcoeff(x^2*(9-38*x+32*x^2)/((1-x)^2*(1-2*x)*(1-4*x)^2+x*O(x^n)),n)
Comments