OFFSET
1,2
COMMENTS
Equals column 2 of triangle A110200.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
EXAMPLE
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.
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 *)
PROG
(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)
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jul 16 2005
STATUS
approved