OFFSET
1,2
COMMENTS
This map is a variation of the Collatz (or 3n+1) map:
Instead of considering the parity of the number, we look at prime(n) mod 3 to decide if this prime should be halved or doubled, before going to the next prime (A007918) and finally back to the positive integers via PrimePi (A000720).
Exactly as for the Collatz (3n+1) map (defined on nonnegative integers), the first element for which it is defined is its only fixed point, and all other starting values seem to end up in a cycle of length 3, here: 4 -> 7 -> 5 -> 4.
Except for p=3, no prime yields a prime result under the map A138750 (as can be seen using p=6k+1 or p=6k-1). Therefore instead of applying primepi() after nextprime(), one could also simply use 1+primepi().
LINKS
EXAMPLE
MATHEMATICA
A138754[n_]:=With[{p=Prime[n]}, PrimePi[NextPrime[If[Mod[p, 3]==2, p/2, 2p]]]]; Array[A138754, 100] (* Paolo Xausa, Jul 28 2023 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
M. F. Hasler, Apr 01 2008
STATUS
approved