OFFSET
1,4
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) + a(n-1) + a(n-2) = n-th prime, where a(0)=1, a(-1)=0, a(-2)=0 and the 0th prime is taken to be 1.
EXAMPLE
At n=10, a(10) + a(9) + a(8) = 13 + 9 + 7 = 29 = p_10.
MATHEMATICA
a[0] = 1; a[-1] = 0; a[-2] = 0; p[0] = 1; p[n_?Positive] := Prime[n]; a[n_] := a[n] = p[n] - a[n-1] - a[n-2]; Table[a[n], {n, 0, 69}] (* Jean-François Alcover, Sep 30 2011 *)
nxt[{a_, b_, c_}]:={b, c, NextPrime[a+b+c]-(b+c)}; Transpose[NestList[nxt, {1, 1, 1}, 70]][[1]] (* Harvey P. Dale, Mar 15 2015 *)
PROG
(Haskell)
a073737 n = a073737_list !! (n-1)
a073737_list =
1 : 1 : zipWith (-) a065091_list
(zipWith (+) a073737_list $ tail a073737_list)
-- Reinhard Zumkeller, Aug 14 2011
CROSSREFS
KEYWORD
easy,nice,nonn
AUTHOR
Paul D. Hanna, Aug 07 2002
STATUS
approved