login
A090546
Position of first occurrence of n in A090544.
3
2, 6, 4, 10, 16, 11, 24, 17, 35, 26, 69, 53, 113, 184, 149, 124, 99, 78, 224, 182, 148, 118, 94, 73, 304, 309, 255, 209, 170, 137, 561, 470, 393, 327, 270, 238, 194, 157, 443, 1352, 1161, 994, 848, 720, 609, 512, 430, 2967, 2602, 5056, 4451, 7132, 6311, 6475, 5722
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
Sequence in context: A065880 A335063 A371285 * A242901 A353731 A266013
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Dec 09 2003
EXTENSIONS
More terms from R. J. Mathar, Apr 28 2007
STATUS
approved