OFFSET
1,3
FORMULA
a(n) = If[a(n - 1) - Prime[n] > 0, Abs[a(n - 1) - 2*n], If[a[n - 1] - Prime[n] < 0, Abs[a(n - 1) + 2*n], Fibonacci[n] - a(n - 1)]].
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := a[n] = If[a[n - 1] - Prime[n] > 0, Abs[a[n - 1] - 2*n], If[a[n - 1] - Prime[n] < 0, Abs[a[n - 1] + 2*n], Fibonacci[n] - a[n - 1]]]; Table[a[n], {n, 0, 50}]
CROSSREFS
KEYWORD
uned,sign
AUTHOR
Roger L. Bagula, Oct 01 2008
STATUS
approved