OFFSET
1,3
COMMENTS
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,1,0,0,1,-1,-1).
FORMULA
O.g.f.: x/((1-x)*(x^4 + x^3 + x^2 + x + 1)*(1 - x - x^2)). - R. J. Mathar, May 30 2008
a(n+5) = a(n) + Fibonacci(n+5), n>5.
a(n) = 12*a(n-5) - 10*a(n-10) - a(n-15). - Gary Detlefs, Dec 10 2010
EXAMPLE
a(6) = a(5) + a(4) + 1 = 5 + 3 + 1 = 9 because n=5 is a multiple of 5.
a(7) = a(6) + a(5) = 9 + 5 = 14 because n=6 is not a multiple of 5.
MAPLE
A124502:=proc(n) option remember; local t1; if n <= 2 then return 1; fi: if n mod 5 = 1 then t1:=1 else t1:=0; fi: procname(n-1)+procname(n-2)+t1; end proc; [seq(A124502(n), n=1..100)]; # N. J. A. Sloane, May 25 2008
MATHEMATICA
a=0; b=0; lst={a, b}; Do[z=a+b+1; AppendTo[lst, z]; a=b; b=z; z=a+b; AppendTo[lst, z]; a=b; b=z; z=a+b; AppendTo[lst, z]; a=b; b=z; z=a+b; AppendTo[lst, z]; a=b; b=z; z=a+b; AppendTo[lst, z]; a=b; b=z, {n, 4!}]; lst (* Vladimir Joseph Stephan Orlovsky, Feb 16 2010 *)
nxt[{n_, a_, b_}]:={n+1, b, If[Divisible[n, 5], a+b+1, a+b]}; NestList[nxt, {2, 1, 1}, 40][[All, 2]] (* or *) LinearRecurrence[{1, 1, 0, 0, 1, -1, -1}, {1, 1, 2, 3, 5, 9, 14}, 40] (* Harvey P. Dale, Jun 15 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 25 2008
EXTENSIONS
Typo in Maple code corrected by R. J. Mathar, May 30 2008
More specific name from R. J. Mathar, Dec 09 2009
Indices in definition corrected by N. J. A. Sloane, Nov 25 2010
STATUS
approved