OFFSET
1,7
COMMENTS
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1,0,0,0,1).
FORMULA
G.f.: x^2*(1-x^2+x^3) / ( (1-x^2+x^4)*(1-x^2-x^4) ). - R. J. Mathar, Jan 27 2011
a(n) = (1/2)*(A110161(n-3) - A110161(n-2) + A079977(n-2) + A079977(n-1)). - G. C. Greubel, Oct 23 2024
EXAMPLE
As consecutive pairs: (0,1),(0,1),(1,1),(2,1),(3,2),(4,4),...
MATHEMATICA
nxt[{n_, a_, b_, c_, d_, e_}]:={n+1, b, c, d, e, If[EvenQ[n], d+c, d+a]}; NestList[nxt, {5, 0, 1, 0, 1, 1}, 50][[All, 2]] (* or *) LinearRecurrence[ {0, 2, 0, -1, 0, 0, 0, 1}, {0, 1, 0, 1, 1, 1, 2, 1}, 60] (* Harvey P. Dale, Nov 15 2019 *)
PROG
(Magma)
R<x>:=PowerSeriesRing(Integers(), 70);
[0] cat Coefficients(R!( x^2*(1-x^2+x^3)/((1-x^2+x^4)*(1-x^2-x^4)) )); // G. C. Greubel, Oct 23 2024
(SageMath)
def A174618(n): return (kronecker(12, n-3) - kronecker(12, n-2) + ((n+1)%2)*fibonacci(n//2) + (n%2)*fibonacci((n+1)//2))//2
[A174618(n) for n in range(1, 71)] # G. C. Greubel, Oct 23 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mark Dols, Mar 23 2010
STATUS
approved