OFFSET
1,1
MAPLE
f := proc(k) k+numtheory[pi](k) ; end: A090544 := proc(n) local a, frep ; a := 1 ; frep := f(n) ; while not isprime(frep) do frep := f(frep) ; a := a+1 ; od ; RETURN(a) ; end: A090546 := proc(nmax) local a, m ; a := [seq(0, i=1..nmax)] ; for m from 2 to 10000 do a090544 := A090544(m) ; if a090544 <= nops(a) and op(a090544, a) = 0 then a := subsop(a090544=m, a) ; print(a090544, m) ; fi ; od ; RETURN(a) ; end: A090546(80) ; # R. J. Mathar, Apr 28 2007
MATHEMATICA
nt = 55; (* required number of terms *)
pos[_] = 0;
f[k_] := k + PrimePi[k];
g[n_] := NestWhileList[f, f[n], CompositeQ] // Length;
s[m_] := With[{gn = g[n]}, Do[If[pos[gn] == 0, pos[gn] = n], {n, 2, m}]; Array[pos, nt]];
m = nt;
While[AnyTrue[s[m], # == 0&], m += nt];
s[m] (* Jean-François Alcover, Jul 31 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Dec 09 2003
EXTENSIONS
More terms from R. J. Mathar, Apr 28 2007
STATUS
approved