A131568 a(n) = sum of numbers which in base 2 contain exactly n digits 1 and not more than n digits 0.
0, 3, 45, 630, 8925, 128898, 1891890, 28113228, 421717725, 6372696330, 96865261350, 1479397776948, 22684103302770, 348986220258900, 5384358887026500, 83278084352019480, 1290810308357922525, 20045524792117559130, 311819274557663622750, 4857816066846093281700
Offset: 0
Examples
For n=2, we have these integers in base 2: 11, 101, 110, 1001, 1010, and 1100; so a(2) = 3+5+6+9+10+12 = 45.
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..832
Programs
-
Mathematica
Array[(4^# - 1)*Binomial[2 #, #]/2 &, 20, 0] (* Michael De Vlieger, Aug 22 2022 *)
Formula
a(n) = (2*n)!*(2^(2*n)-1)/(2*n!*n!). [Corrected by Michel Marcus, Aug 22 2022]
From Peter Luschny, Aug 22 2022: (Start)
a(n) = (4^n - 1)*binomial(2*n, n) / 2.
a(n) = [x^n] ((1 - 16*x)^(-1/2) - (1 - 4*x)^(-1/2)) / 2. (End)
Extensions
More terms from Peter Luschny, Aug 22 2022