login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A138754 a(n) = PrimePi(A138751(n)) - a variation of the Collatz (3n+1) map. 7
1, 4, 2, 7, 4, 10, 5, 13, 6, 7, 19, 22, 9, 24, 10, 10, 11, 31, 33, 12, 35, 38, 14, 15, 45, 16, 47, 17, 48, 17, 55, 19, 20, 60, 22, 63, 66, 67, 24, 24, 25, 73, 25, 77, 26, 79, 83, 87, 31, 89, 31, 31, 93, 31, 32, 33, 33, 101, 102, 35, 104, 35, 113, 37, 115, 38, 122, 123, 41, 126 (list; graph; refs; listen; history; text; internal format)
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().
The prime p=3 is also the only case where n == 2 (mod 3) is not equivalent to n != 1 (mod 3). It might have been a better choice to define A138750(x)=2x if x == 1 (mod 3), ceiling(x/2) otherwise. But since here it makes only a difference for p=3, we use the original definition (cf. A124123).
LINKS
FORMULA
EXAMPLE
a(4) = 7 since prime(4) = 7 == 1 (mod 3), thus A138750(7) = 2*7 = 14, nextprime(14) = 17, PrimePi(17) = 7 (i.e., 17 is the 7th prime).
a(5) = 4 since prime(5) = 11 == 2 (mod 3), thus A138750(11) = ceiling(11/2) = 6, nextprime(6) = 7, PrimePi(7) = 4 (i.e., 7 is the 4th prime).
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 *)
PROG
(PARI) A138754(n)=primepi(A138751(n)) /* see there */
CROSSREFS
Sequence in context: A334417 A195779 A130849 * A021963 A131914 A115302
KEYWORD
easy,nonn
AUTHOR
M. F. Hasler, Apr 01 2008
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 12:08 EDT 2024. Contains 371912 sequences. (Running on oeis4.)