OFFSET
1,1
COMMENTS
All terms are prime.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
N. Fernandez, An order of primeness, F(p)
N. Fernandez, An order of primeness [cached copy, included with permission of the author]
EXAMPLE
11 is a term: prime(11) = 31 -> 11 -> 5 -> 3 -> 2 -> 1, five (a prime number of) steps "->" = pi = A000720.
MAPLE
b:= proc(n) option remember;
`if`(isprime(n), 1+b(numtheory[pi](n)), 0)
end:
a:= proc(n) option remember; local p;
p:= `if`(n=1, 1, a(n-1));
do p:= nextprime(p);
if isprime(b(p)+1) then break fi
od; p
end:
seq(a(n), n=1..62);
MATHEMATICA
b[n_] := b[n] = If[PrimeQ[n], 1 + b[PrimePi[n]], 0];
a[n_] := a[n] = Module[{p}, p = If[n == 1, 1, a[n - 1]];
While[True, p = NextPrime[p]; If[PrimeQ[b[p] + 1], Break[]]]; p];
Table[a[n], {n, 1, 62}] (* Jean-François Alcover, Sep 14 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Mar 16 2020
STATUS
approved