login
A071641
a(n) defined by recursion in the formula section.
0
1, 1, 1, 1, 3, 7, 9, 3, 7, 3, 7, 3, 5, 7, 7, 7, 9, 8, 7, 5, 7, 7, 3, 3, 9, 3, 3, 1, 7, 7, 3, 8, 8, 3, 5, 7, 1, 1, 7, 8, 7, 7, 3, 3, 7, 3, 3, 8, 7, 7, 7, 7, 7, 9, 8, 7, 5, 7, 7, 1, 1, 3, 3, 8, 7, 3, 5, 1, 3, 8, 5, 3, 5, 3, 1, 7, 1, 3, 7, 7, 9, 7, 9, 3, 3, 7, 7, 7, 7, 3, 7, 3, 9, 5, 9, 7, 3, 7, 8, 5, 9, 7, 9, 5, 5
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
Sequence in context: A197682 A021729 A198236 * A093336 A038135 A087655
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