OFFSET
1,2
COMMENTS
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,0,-1,1).
FORMULA
G.f. for number of nonempty subsets of {1,2,...,n} with no gap of length greater than d is x/((1-x)*(1-2*x+x^(d+1))). - Vladeta Jovovic, Apr 27 2008
From Michael Somos, Dec 28 2012: (Start)
G.f.: x/((1-x)^2*(1-x-x^2-x^3-x^4)) = x/((1-x)*(1-2*x+x^5)).
First difference is A107066. (End)
a(n-3) = Sum_{k=0..n} (n-k)*A000078(k) for n>3. - Greg Dresden, Jan 01 2021
EXAMPLE
G.f. = x + 3*x^2 + 7*x^3 + 15*x^4 + 31*x^5 + 62*x^6 + 122*x^7 + 238*x^8 + 462*x^9 + ...
MATHEMATICA
Rest@CoefficientList[Series[x/((1-x)*(1-2*x+x^5)), {x, 0, 40}], x] (* G. C. Greubel, Jun 05 2019 *)
LinearRecurrence[{3, -2, 0, 0, -1, 1}, {1, 3, 7, 15, 31, 62}, 40] (* Harvey P. Dale, Dec 04 2019 *)
PROG
(PARI) {a(n) = if( n<0, n = -n; polcoeff( x^5 / ((1 - x)^2 * (1 + x + x^2 + x^3 - x^4)) + x * O(x^n), n), polcoeff( x / ((1 - x)^2 * (1 - x - x^2 - x^3 - x^4)) + x * O(x^n), n))} /* Michael Somos, Dec 28 2012 */
(PARI) my(x='x+O('x^40)); Vec(x/((1-x)*(1-2*x+x^5))) \\ G. C. Greubel, Jun 05 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( x/((1-x)*(1-2*x+x^5)) )); // G. C. Greubel, Jun 05 2019
(Sage) a=(x/((1-x)*(1-2*x+x^5))).series(x, 40).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Jun 05 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Jul 25 2006
EXTENSIONS
Terms a(25) onward added by G. C. Greubel, Jun 05 2019
STATUS
approved