OFFSET
2,3
EXAMPLE
a(4) = 3, f(4) = 4+2 = 6, f(6) = 6+3 = 9, f(9)= 9+4 = 13 is prime.
a(10) = 4, f(10) = 10+4=14, f(14) = 14+6 = 20, f(20) = 20+8 = 28, f(28) = 28+9 = 37.
MATHEMATICA
f[k_] := k + PrimePi[k];
a[n_] := NestWhileList[f, f[n], CompositeQ] // Length;
Table[a[n], {n, 2, 102}] (* Jean-François Alcover, Jul 31 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Dec 09 2003
EXTENSIONS
More terms from Franklin T. Adams-Watters, Apr 26 2006
STATUS
approved