login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A299963
a(n) = greatest prime factor of the terms in the Collatz sequence starting at n; a(1) = 1.
1
1, 2, 5, 2, 5, 5, 17, 2, 17, 5, 17, 5, 13, 17, 53, 2, 17, 17, 29, 5, 7, 17, 53, 5, 29, 13, 1619, 17, 29, 53, 1619, 2, 29, 17, 53, 17, 37, 29, 101, 5, 1619, 7, 43, 17, 17, 53, 1619, 5, 37, 29, 29, 13, 53, 1619, 1619, 17, 43, 29, 101, 53, 61, 1619, 1619, 2, 37
OFFSET
1,2
COMMENTS
The value 3 cannot appear in this sequence.
The value 1619 appears 1654 times among the first 10000 terms; this is visible as a dashed horizontal line in the corresponding scatterplot.
The most frequent values among the first 10000000 terms are:
Value Number of occurrences among the first 10000000 terms
------- ---------------------------------------------------
283763 16934
2017817 15701
1619 15274
55667 14706
2717873 9913
FORMULA
a(n) = A006530(A178168(n)).
a(2*n) = a(n) for any n > 1.
a(2^k) = 2 for any k > 0.
MATHEMATICA
Table[Max[FactorInteger[#][[-1, 1]]&/@NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>1&]], {n, 70}] (* Harvey P. Dale, Jun 22 2020 *)
PROG
(PARI) a(n) = my (g=1); while (n>1, my (f=factor(n)); g=max(g, f[#f~, 1]); n=if (n%2, 3*n+1, n/2)); return (g)
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Feb 22 2018
STATUS
approved