OFFSET
1,1
COMMENTS
EXAMPLE
x'=x+1=1+1=2, y'=y+x=1+1=2, z'=z+y=1+1=2.
MATHEMATICA
seq[n_Integer?Positive] := Module[{fn01 = 1, fn10 = 1, fnout = 1}, Do[{fn10, fn01, fnout} = {fn10 + 1, fn01 + fn10, fn01 + fnout}, {n - 1}]; {fn10, fn01, fnout}]; Flatten[ Table[ seq[ Prime[n]], {n, 1, 100}]]
PROG
(PARI) a(n)=subst([x, x*(x-1)/2+1, (x^3-3*x^2+8*x)/6], x, prime(1+(n-1)\3))[1+(n-1)%3]
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Jun 17 2002
EXTENSIONS
Edited by Robert G. Wilson v, Jul 03 2002
STATUS
approved