A054877 Closed walks of length n along the edges of a pentagon based at a vertex.
1, 0, 2, 0, 6, 2, 20, 14, 70, 72, 254, 330, 948, 1430, 3614, 6008, 13990, 24786, 54740, 101118, 215766, 409640, 854702, 1652090, 3396916, 6643782, 13530350, 26667864, 53971350, 106914242, 215492564, 428292590, 860941798, 1714834440, 3441074654, 6863694378
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,3,-2).
Programs
-
GAP
List([0..40], n-> (2^n + 2*(-1)^n*Lucas(1,-1, n)[2])/5); # G. C. Greubel, Jul 19 2019
-
Magma
[(2^n + 2*(-1)^n*Lucas(n))/5: n in [0..40]]; // G. C. Greubel, Jul 19 2019
-
Mathematica
CoefficientList[Series[(1/5)*(1/(1-2*x) +2*(2+x)/(1+x-x^2)), {x, 0, 40}], x] (* G. C. Greubel, Jun 07 2017 *)
-
PARI
vector(40, n, n--; f=fibonacci; (2^n + 2*(-1)^n*(f(n+1)+f(n-1) ))/5) \\ G. C. Greubel, Jun 07 2017, modified Jul 19 2019
-
Sage
[(2^n + 2*(-1)^n*lucas_number2(n,1,-1))/5 for n in (0..40)] # G. C. Greubel, Jul 19 2019
Formula
a(n) = 2*A052964(n) for n>0.
G.f.: (1/5)*(1/(1-2*x) + 2*(2+x)/(1+x-x^2)).
5*a(n) = 2^n +2*(-1)^n*A000032(n).
a(n) = (2^n/5)*Sum_{k=0..4} cos(2*Pi*k/5)^n. - Herbert Kociemba, May 31 2004
Recurrence: a(n) = 5*(a(n-2) - a(n-4)) + 2*a(n-5). - Herbert Kociemba, Jun 04 2004
Comments