OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
R. J. Mathar, Counting Walks on Finite Graphs, Nov 2020, Section 7.
Index entries for linear recurrences with constant coefficients, signature (2,8).
FORMULA
a(n) = 4*A003683(n-1) + 0^n/2, n >= 0.
a(n) = (4^n + (-1)^n*2^(n+1) + 3*0^n)/6.
G.f.: (1/6)*(3 + 2/(1+2*x) + 1/(1-4*x)).
From L. Edson Jeffery, Apr 22 2015: (Start)
G.f.: (1-2*x-4*x^2)/((1+2*x)*(1-4*x)).
a(n) = 8*A246036(n-3) + 0^n/2, n >= 0. (End)
a(n) = 2^n*A001045(n-1) + (1/2)*[n=0] = 2^n*(2^(n-1) + (-1)^n)/3 + (1/2)*[n=0], n >= 0. - Ralf Steiner, Aug 27 2020, edited by M. F. Hasler, Sep 11 2020
E.g.f.: (1/6)*(exp(4*x) + 2*exp(-2*x) + 3). - G. C. Greubel, Feb 06 2023
MATHEMATICA
CoefficientList[Series[(1-2*x-4*x^2)/((1+2x)*(1-4x)), {x, 0, 40}], x] (* L. Edson Jeffery, Apr 22 2015 *)
LinearRecurrence[{2, 8}, {1, 0, 4}, 41] (* G. C. Greubel, Feb 06 2023 *)
PROG
(Magma) [(4^n+(-1)^n*2^(n+1)+3*0^n)/6: n in [0..30]]; // Vincenzo Librandi, Apr 23 2015
(SageMath) [(4^n + (-1)^n*2^(n+1) + 3*0^n)/6 for n in range(31)] # G. C. Greubel, Feb 06 2023
CROSSREFS
KEYWORD
nonn,walk,easy
AUTHOR
Paolo Dominici (pl.dm(AT)libero.it), May 23 2000
STATUS
approved