OFFSET
1,2
FORMULA
a(n) = A121559(n-1) + 1 for n >= 2. - Pontus von Brömssen, Jul 31 2022
EXAMPLE
Iteration procedure for n = 6: 6 mod 5 = 1 = a(6).
Iteration procedure for n = 7: 7 mod 5 = 2 = a(7).
MAPLE
MATHEMATICA
f[n_] := Switch[n, 1, 1, 2, 2, _, n - NextPrime[n, -1]];
a[n_] := FixedPoint[f, n];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 13 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Jan 23 2010
EXTENSIONS
More terms from R. J. Mathar, Feb 19 2010
STATUS
approved