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.

Showing 1-4 of 4 results.

A110200 Triangle, read by rows, where T(n,k) equals the sum of squares of numbers < 2^n having exactly k ones in their binary expansion.

Original entry on oeis.org

1, 5, 9, 21, 70, 49, 85, 395, 535, 225, 341, 1984, 3906, 3224, 961, 1365, 9429, 24066, 29274, 17241, 3969, 5461, 43434, 135255, 215900, 188595, 86106, 16129, 21845, 196095, 717825, 1412275, 1628175, 1106445, 411995, 65025, 87381, 872788
Offset: 1

Views

Author

Paul D. Hanna, Jul 16 2005

Keywords

Comments

Compare to triangle A110205 (sum of cubes).

Examples

			Row 4 is formed by sums of squares of numbers < 2^4:
T(4,1) = 1^2 + 2^2 + 4^2 + 8^2 = 85;
T(4,2) = 3^2 + 5^2 + 6^2 + 9^2 + 10^2 + 12^2 = 395;
T(4,3) = 7^2 + 11^2 + 13^2 + 14^2 = 535;
T(4,4) = 15^2 = 225.
Triangle begins:
1;
5, 9;
21, 70, 49;
85, 395, 535, 225;
341, 1984, 3906, 3224, 961;
1365, 9429, 24066, 29274, 17241, 3969;
5461, 43434, 135255, 215900, 188595, 86106, 16129;
21845, 196095, 717825, 1412275, 1628175, 1106445, 411995, 65025;
87381, 872788, 3662848, 8541876, 12197570, 10974236, 6095208, 1915228, 261121; ...
Row g.f.s are:
row 1: (1 + 1*x)/(1+x);
row 2: (5 + 9*x);
row 3: (21 + 49*x)*(1+x);
row 4: (85 + 225*x)*(1+x)^2.
G.f. for row n is:
((4^n-1)/3 + (2^n-1)^2*x)*(1+x)^(n-2).
		

Crossrefs

Cf. A110201 (central terms), A002450 (column 1), A110202 (column 2), A110203 (column 3), A110204 (column 4), A016290 (row sums), A110205.

Programs

  • PARI
    T(n,k)=(4^n-1)/3*binomial(n-2,k-1)+(2^n-1)^2*binomial(n-2,k-2)
    for(n=1, 15, for(k=1, n, print1(T(n, k), ", ")); print(""))
    
  • PARI
    /* Using G.f. of A(x,y): */
    T(n,k)=my(X=x+x*O(x^n),Y=y+y*O(y^k));if(n
    				
  • PARI
    /* Sum of Squares of numbers<2^n with k 1-bits: */
    T(n,k)=my(B=vector(n+1));if(n
    				

Formula

T(n,k) = (4^n-1)/3 * C(n-2, k-1) + (2^n-1)^2 * C(n-2, k-2).
G.f.: A(x,y) = x*y*(1-2*x*(1-y)) / ((1-x*(1+y))*(1-2*x*(1+y))*(1-4*x*(1+y))).
G.f. for row n: ((4^n-1)/3 + (2^n-1)^2*x)*(1+x)^(n-2).

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.

A110201 a(n) = sum of squares of numbers < 2^n having exactly [n/2]+1 ones in their binary expansion.

Original entry on oeis.org

1, 9, 70, 535, 3906, 29274, 215900, 1628175, 12197570, 92830430, 704127060, 5400199350, 41331491124, 318871044756, 2456608834680, 19039140186495, 147401590706370, 1146463189301430, 8909683732878500, 69495629981713650
Offset: 1

Views

Author

Paul D. Hanna, Jul 16 2005

Keywords

Comments

a(n) equals the largest term in row n of triangle A110200.

Crossrefs

Cf. A110200 (triangle), A002450 (column 1), A110202 (column 2), A110203 (column 3), A110204 (column 4).

Programs

  • Mathematica
    Join[{1},Table[Total[Select[Range[2^n],DigitCount[#,2,1]==Floor[ n/2]+ 1&]^2],{n,2,20}]] (* Harvey P. Dale, Aug 22 2021 *)
  • PARI
    a(n)=(4^n-1)/3*binomial(n-2,n\2)+(2^n-1)^2*binomial(n-2,n\2-1)

Formula

a(n) = (4^n-1)/3*C(n-2, n\2) + (2^n-1)^2*C(n-2, n\2-1).

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

Original entry on oeis.org

0, 0, 0, 225, 3224, 29274, 215900, 1412275, 8541876, 48876212, 268288008, 1425694725, 7381073920, 37399844174, 186110137668, 911952794935, 4409472232060, 21073909951080, 99688911645264, 467292120940425
Offset: 1

Views

Author

Paul D. Hanna, Jul 16 2005

Keywords

Comments

Equals column 4 of triangle A110200.

Crossrefs

Cf. A110200 (triangle), A110201 (central terms), A002450 (column 1), A110202 (column 2), A110203 (column 3).

Programs

  • PARI
    {a(n)=polcoeff(x^4*(225-2626*x+12500*x^2-30872*x^3+41536*x^4-28928*x^5+8192*x^6)/ ((1-x)^4*(1-2*x)^3*(1-4*x)^4+x*O(x^n)),n)}

Formula

G.f.: x^4*(225-2626*x+12500*x^2-30872*x^3+41536*x^4-28928*x^5+8192*x^6)/ ((1-x)^4*(1-2*x)^3*(1-4*x)^4).
Showing 1-4 of 4 results.