cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A138754 a(n) = PrimePi(A138751(n)) - a variation of the Collatz (3n+1) map.

Original entry on oeis.org

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
Offset: 1

Views

Author

M. F. Hasler, Apr 01 2008

Keywords

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).

Examples

			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).
		

Crossrefs

Programs

Formula