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.

A299963 a(n) = greatest prime factor of the terms in the Collatz sequence starting at n; a(1) = 1.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 22 2018

Keywords

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

Crossrefs

Programs

  • Mathematica
    Table[Max[FactorInteger[#][[-1,1]]&/@NestWhileList[If[EvenQ[#],#/2,3#+1]&, n,#>1&]], {n,70}] (* Harvey P. Dale, Jun 22 2020 *)
  • 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)

Formula

a(n) = A006530(A178168(n)).
a(2*n) = a(n) for any n > 1.
a(2^k) = 2 for any k > 0.