A071641 a(n) defined by recursion in the formula section.
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
References
- Ivars Peterson, The Jungles of Randomness, 1998, John Wiley and Sons, Inc., page 207.
Programs
-
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}];
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.
Extensions
Edited by Robert G. Wilson v, Jun 25 2002
Edited by the Associate Editors of the OEIS, Jan 28 2022
Comments