OFFSET
1,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,4,0,0,1).
FORMULA
a(3n+2) =0, a(3n) = F(3n), a(3n+1) = F(3n+2).
G.f.: -x*(1+2*x^2+x^3) / ( (x^2+x-1)*(x^4-x^3+2*x^2+x+1) ). - R. J. Mathar, Jun 23 2014
MAPLE
with(combinat): a[1]:=1: for n from 1 to 50 do if fibonacci(n+1)<=a[n] then a[n+1]:=a[n]-fibonacci(n+1) else a[n+1]:=a[n]+fibonacci(n+1) fi od: seq(a[n], n=1..51); # Emeric Deutsch, Aug 11 2005
MATHEMATICA
nxt[{n_, a_}]:=Module[{fib=Fibonacci[n+1]}, {n+1, If[fib<=a, a-fib, a+fib]}]; Transpose[NestList[nxt, {1, 1}, 50]][[2]] (* Harvey P. Dale, Nov 21 2012 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Aug 05 2005
EXTENSIONS
More terms from Emeric Deutsch, Aug 11 2005
STATUS
approved