cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A110202 a(n) = sum of squares of numbers < 2^n having exactly 2 ones in their binary representation.

Original entry on oeis.org

0, 9, 70, 395, 1984, 9429, 43434, 196095, 872788, 3842729, 16773118, 72693075, 313158312, 1342144509, 5726557522, 24338016935, 103078952956, 435222828369, 1832518331046, 7696579297275, 32252336887120, 134873417951909
Offset: 1

Views

Author

Paul D. Hanna, Jul 16 2005

Keywords

Comments

Equals column 2 of triangle A110200.

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.
		

Crossrefs

Cf. A110200 (triangle), A110201 (central terms), A002450 (column 1), A110203 (column 3), A110204 (column 4), A018900.

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)

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.