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
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.
-
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 *)
-
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)
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
-
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 *)
-
a(n)=(4^n-1)/3*binomial(n-2,n\2)+(2^n-1)^2*binomial(n-2,n\2-1)
A110203
a(n) = sum of squares of numbers < 2^n having exactly 3 ones in their binary representation.
Original entry on oeis.org
0, 0, 49, 535, 3906, 24066, 135255, 717825, 3662848, 18158932, 88043517, 419348475, 1968346446, 9126412278, 41875079155, 190408381765, 858989527020, 3848282308584, 17134038373689, 75866264567775, 334251455152090
Offset: 1
For n=4, the sum of the squares of numbers < 2^4
having exactly 3 ones in their binary digits is:
a(4) = 7^2 + 11^2 + 13^2 + 14^2 = 535.
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
A110205
Triangle, read by rows, where T(n,k) equals the sum of cubes of numbers < 2^n having exactly k ones in their binary expansion.
Original entry on oeis.org
1, 9, 27, 73, 368, 343, 585, 3825, 6615, 3375, 4681, 36394, 88536, 86614, 29791, 37449, 332883, 1024002, 1449198, 970677, 250047, 299593, 2979420, 10970133, 20078192, 19714083, 9974580, 2048383, 2396745, 26298405, 112122225, 250021125, 320944275, 239783895, 97221555, 16581375
Offset: 1
Row 4 is formed by sums of cubes of numbers < 2^4:
T(4,1) = 1^3 + 2^3 + 4^3 + 8^3 = 585;
T(4,2) = 3^3 + 5^3 + 6^3 + 9^3 + 10^3 + 12^3 = 3825;
T(4,3) = 7^3 + 11^3 + 13^3 + 14^3 = 6615;
T(4,4) = 15^3 = 3375.
Triangle begins:
1;
9, 27;
73, 368, 343;
585, 3825, 6615, 3375;
4681, 36394, 88536, 86614, 29791;
37449, 332883, 1024002, 1449198, 970677, 250047;
299593, 2979420, 10970133, 20078192, 19714083, 9974580, 2048383;
2396745, 26298405, 112122225, 250021125, 320944275, 239783895, 97221555, 16581375; ...
Row g.f.s are:
row 1: (1 + 2*x + 1*x^2)/(1+x)^2;
row 2: (9 + 36*x + 27*x^2)/(1+x);
row 3: (73 + 368*x + 343*x^2);
row 4: (585 + 3240*x + 3375*x^2)*(1+x).
G.f. for row n is:
((8^n-1)/7 + ((2^n-1)*(4^n-1)-(8^n-1)/7)*x + (2^n-1)^3*x^2)*(1+x)^(n-3).
-
b:= func< n,k | Binomial(n-3, k) >;
A110205:= func< n,k | (8^n-1)/7*(b(n,k-1) -b(n,k-2)) +(2^n-1)^2*((2^n+1)*b(n,k-2) +(2^n-1)*b(n,k-3)) >;
[A110205(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Oct 03 2024
-
b[n_, k_]= Binomial[n-3, k];
T[n_, k_]:= (8^n-1)/7*(b[n,k-1] -b[n,k-2]) + (2^n-1)^2*((2^n+1)*b[n,k-2] + (2^n-1)*b[n,k-3]);
A110205[n_, k_]:= If[n<3, T[n,k]/2, T[n,k]];
Table[A110205[n,k], {n,12}, {k,n}]//Flatten (* G. C. Greubel, Oct 03 2024 *)
-
T(n,k)=(8^n-1)/7*binomial(n-3,k-1)+((2^n-1)*(4^n-1)-(8^n-1)/7)*binomial(n-3,k-2) +(2^n-1)^3*binomial(n-3,k-3)
-
/* Sum of cubes of numbers<2^n with k 1-bits: */
T(n,k)=local(B=vector(n+1));if(n
-
def b(n,k): return binomial(n-3, k)
def A110205(n,k): return (8^n-1)/7*(b(n,k-1) - b(n,k-2)) + (2^n-1)^2*((2^n+1)*b(n,k-2) + (2^n-1)*b(n,k-3))
flatten([[A110205(n,k) for k in range(1,n+1)] for n in range(1,13)]) # G. C. Greubel, Oct 03 2024
Showing 1-5 of 5 results.
Comments