OFFSET
1,4
COMMENTS
The variance v(n) = Sum_{k=0..2^n-n-1} (k - m(n))^2*p(n,k) of the distribution function p(n,k) = binomial(2^n -n-1, k)/2^(2^n -n-1) with m(n) its mean value is 0., 0.25, 1., 2.75, 6.5, 14.25, 30., 61.75, 125.5, 253.25, 509., 1020.75, 2044.5, 4092.25, 8188... We set a(n) = round(v(n)).
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-2,0,1,-3,2).
FORMULA
a(n) = round((2^n -n -1)/4).
G.f.: x^3*(1 -x^3 +x^4)/(1 -3*x +2*x^2 -x^4 +3*x^5 -2*x^6). [sign corrected by Georg Fischer, Apr 17 2020]
v(n) = (1/8)*2^n -1/4 + v(-1+n) with v(1) = 0 and a(n) = round(v(n)).
a(n) = round(A000295(n)/4). - G. C. Greubel, Feb 20 2021
MAPLE
MATHEMATICA
nn:=33; Rest[CoefficientList[Series[x^3*(1-x^3+x^4)/(1-3*x+2*x^2-2*x^6-x^4+3*x^5), {x, 0, nn}], x]] (* Georg Fischer, Apr 17 2020 *)
LinearRecurrence[{3, -2, 0, 1, -3, 2}, {0, 0, 1, 3, 7, 14, 30}, 40] (* Harvey P. Dale, Feb 06 2023 *)
PROG
(Sage) [round((2^n -n -1)/4) for n in (1..40)] # G. C. Greubel, Feb 20 2021
(Magma) [Round((2^n -n-1)/4): n in [1..40]]; // G. C. Greubel, Feb 20 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Wieder, Feb 07 2010
EXTENSIONS
Edited by Georg Fischer and Joerg Arndt, Apr 17 2020
STATUS
approved