OFFSET
1,1
COMMENTS
Also (starting 6,10,...) the number of zig-zag paths from top to bottom of a rectangle of width 6. - Joseph Myers, Dec 23 2008
Number of walks of length n on the path graph P_6. - Andrew Howroyd, Apr 17 2017
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
B. Malesevic, Some combinatorial aspects of differential operation composition on the space R^n, Univ. Beograd, Publ. Elektrotehn. Fak., Ser. Mat. 9 (1998), 29-33.
Branko Malesevic, Some combinatorial aspects of differential operation compositions on space R^n, arXiv:0704.0750 [math.DG], 2007.
Joseph Myers, BMO 2008--2009 Round 1 Problem 1---Generalisation
Index entries for linear recurrences with constant coefficients, signature (1,2,-1).
FORMULA
Equals 2 * A090990.
a(k+6) = 5*a(k+4) - 6*a(k+2) + a(k).
From Colin Barker, May 03 2012: (Start)
a(n) = a(n-1) + 2*a(n-2) - a(n-3).
G.f.: 2*x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3). (End)
MAPLE
NUM := proc(k :: integer) local i, j, n, Fun, Identity, v, A; n := 10; # <- DIMENSION Fun := (i, j)->piecewise(((j=i+1) or (i+j=n+1)), 1, 0); Identity := (i, j)->piecewise(i=j, 1, 0); v := matrix(1, n, 1); A := piecewise(k>1, (matrix(n, n, Fun))^(k-1), k=1, matrix(n, n, Identity)); return(evalm(v&*A&*transpose(v))[1, 1]); end:
MATHEMATICA
a[n_ /; n <= 6] := {10, 18, 32, 58, 104, 188}[[n]]; a[n_] := a[n] = 5*a[n-2] - 6*a[n-4] + a[n-6]; Array[a, 31] (* Jean-François Alcover, Oct 07 2017 *)
2*LinearRecurrence[{1, 2, -1}, {5, 9, 16}, 40] (* G. C. Greubel, Feb 02 2019 *)
PROG
(PARI) my(x='x+O('x^40)); Vec(2*x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3)) \\ G. C. Greubel, Feb 02 2019
(Magma) m:=40; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!( 2*x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3) )); // G. C. Greubel, Feb 02 2019
(Sage) a=(2*x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3)).series(x, 40).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 02 2019
(GAP) a:=[10, 18, 32];; for n in [4..30] do a[n]:=a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, Feb 02 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Branko Malesevic, Feb 29 2004
EXTENSIONS
More terms from Joseph Myers, Dec 23 2008
STATUS
approved