login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A321132
a(n) is the number of iterations of the mapping of x -> pi(x) until n reaches the main line as defined by A007097.
0
0, 0, 0, 2, 0, 2, 3, 3, 3, 3, 0, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
OFFSET
1,4
COMMENTS
All primes are either on the main line or will join it before reaching 0, as in A060197 or 1, as in A071578.
First occurrence of k, k=0,1,2,...: 1, 4, 7, 17, 59, 277, 1787, 15299, 167449, 2269733, etc.
A measure of Primeness - see the Fernandez link.
FORMULA
a(n) = 0 iff n is a member of A007097.
EXAMPLE
a(10) is 3 because the tenth prime is 29 -> 10 -> 4 -> 2 and 2 is A007097(1).
MATHEMATICA
f[n_] := Length@ NestWhileList[PrimePi, n, ! MemberQ[{1, 2, 3, 5, 11, 31, 127, 709, 5381, 52711, 648391, 9737333, 174440041}, #] &] - 1; Array[f, 105]
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Oct 27 2018
STATUS
approved