login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A110202
a(n) = sum of squares of numbers < 2^n having exactly 2 ones in their binary representation.
5
0, 9, 70, 395, 1984, 9429, 43434, 196095, 872788, 3842729, 16773118, 72693075, 313158312, 1342144509, 5726557522, 24338016935, 103078952956, 435222828369, 1832518331046, 7696579297275, 32252336887120, 134873417951909
OFFSET
1,2
COMMENTS
Equals column 2 of triangle A110200.
LINKS
FORMULA
G.f.: x^2*(9-38*x+32*x^2)/( (1-x)^2*(1-2*x)*(1-4*x)^2 ). a(n) = Sum_{k|A018900(k)<2^n} A018900(k)^2.
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
Cf. A110200 (triangle), A110201 (central terms), A002450 (column 1), A110203 (column 3), A110204 (column 4), A018900.
Sequence in context: A193706 A275680 A167534 * A110201 A045739 A098205
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jul 16 2005
STATUS
approved