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!)
A266551 Image of n under the 3p+1 map, which is a variation of the 3x+1 (Collatz) map. 1
7, 10, 2, 16, 3, 22, 4, 3, 5, 34, 6, 40, 7, 5, 8, 52, 9, 58, 10, 7, 11, 70, 12, 5, 13, 9, 14, 88, 15, 94, 16, 11, 17, 7, 18, 112, 19, 13, 20, 124, 21, 130, 22, 15, 23, 142, 24, 7, 25, 17, 26, 160, 27, 11, 28, 19, 29, 178, 30, 184, 31, 21, 32, 13, 33, 202, 34, 23, 35, 214, 36, 220, 37, 25 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,1
COMMENTS
The 3p+1 map is defined for n >= 2 as follows: if n is prime, then map n to 3n+1; otherwise, map n to n divided by the smallest prime divisor of n.
The 3p+1 sequence for n >= 2 is defined as follows: b(0) = n; b(n+1) = 3 * b(n) + 1 if b(n) is prime; otherwise, b(n+1) = b(n) divided by the smallest prime factor of b(n).
It seems that all 3p+1 sequences reach 2. This has been verified for n up to 5*10^8. Once a 3p+1 sequence reaches 2, it repeats the following cycle: 2, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, ...
LINKS
Jack Brennen, Felice Russo, A Collatz-like sequence.
EXAMPLE
For n = 2, a(2) = 2*3 + 1 = 7, because 2 is prime.
For n = 6, a(6) = 6 / 2 = 3, because 6 is composite; 2 is the smallest prime factor of 6.
MATHEMATICA
a[n_]:=If[PrimeQ[n], 3n + 1, n/FactorInteger[n][[1, 1]]]; Table[a[n], {n, 2, 100}] (* Indranil Ghosh, Apr 22 2017 *)
PROG
(PARI) a(n) = if (isprime(n), 3*n+1, n/factor(n)[1, 1]); \\ Michel Marcus, Jan 02 2016
(Python)
from sympy import isprime, primefactors
def a(n): return 3*n + 1 if isprime(n) else n//min(primefactors(n))
print([a(n) for n in range(2, 101)]) # Indranil Ghosh, Apr 22 2017
CROSSREFS
Cf. A175871 (the repeating cycle starting at 2).
Cf. A006370 (image of n under the 3x+1 map).
Sequence in context: A082705 A122577 A180732 * A070405 A010730 A225694
KEYWORD
nonn
AUTHOR
Robert C. Lyons, Dec 31 2015
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 18 16:22 EDT 2024. Contains 371780 sequences. (Running on oeis4.)