OFFSET
0,5
COMMENTS
All terms are in {1, 3, 5, 7, 8, 9}.
REFERENCES
Ivars Peterson, The Jungles of Randomness, 1998, John Wiley and Sons, Inc., page 207.
FORMULA
a(n) = 10 - (prime(g(n)) mod 10) with g(n) = 9 - (f(n) mod 9) and f(n) = f(n-1) + f(n-4) + floor((f(n-1) + f(n-4))/10) for n>= 4, f(n) = 1 for n<4.
MATHEMATICA
f[0]=f[1]=f[2]=f[3]=1; f[x_] := f[x]=f[x-1]+f[x-4]+Floor[f[x-1]/10+f[x-4]/10];
g[x_] := g[x]=9-Mod[f[x], 9];
h[x_] := h[x]=10-Mod[Prime[g[x]], 10];
Table[h[n], {n, 0, 200}];
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Roger L. Bagula, Jun 22 2002
EXTENSIONS
Edited by Robert G. Wilson v, Jun 25 2002
Edited by the Associate Editors of the OEIS, Jan 28 2022
STATUS
approved