OFFSET
1,1
COMMENTS
Old (incorrect) name was: Primes not appearing in A121543.
Number of terms less than 10^n: 1, 6, 30, 165, 1024, ... .
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1025 terms from Zak Seidov and Robert G. Wilson v)
Michael P. May, Properties of Higher-Order Prime Number Sequences, Missouri J. Math. Sci. (2020) Vol. 32, No. 2, 158-170; and arXiv version, arXiv:2108.04662 [math.NT], 2021.
Michael P. May, Application of the Inclusion-Exclusion Principle to Prime Number Subsequences, arXiv:2402.13214 [math.GM], 2024.
FORMULA
From Alois P. Heinz, Mar 15 2020: (Start)
{ p in primes : A078442(p) mod 2 = 0 }.
a(n) = prime(A333242(n)). (End)
EXAMPLE
11 is a term: 11 -> 5 -> 3 -> 2 -> 1, four (an even 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:= a(n-1);
do p:= nextprime(p);
if b(p)::even then break fi
od; p
end: a(1):=3:
seq(a(n), n=1..60); # Alois P. Heinz, Mar 15 2020
MATHEMATICA
fQ[n_] := If[ !PrimeQ[n] || (PrimeQ[n] && FreeQ[lst, PrimePi[n]]), AppendTo[lst, n]]; k = 2; lst = {1}; While[k < 2401, fQ@ k; k++]; Select[lst, PrimeQ]
PROG
(PARI) b(n)={my(k=0); while(isprime(n), k++; n=primepi(n)); k};
apply(prime, select(n->b(n)%2, [1..500])) \\ Michel Marcus, Jan 03 2022; after A333242
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov and Robert G. Wilson v, Sep 17 2015
EXTENSIONS
New name from Alois P. Heinz, Mar 15 2020
STATUS
approved