login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #22 Jul 16 2022 12:33:47

%S 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,

%T 1619,17,29,53,1619,2,29,17,53,17,37,29,101,5,1619,7,43,17,17,53,1619,

%U 5,37,29,29,13,53,1619,1619,17,43,29,101,53,61,1619,1619,2,37

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

%C The value 3 cannot appear in this sequence.

%C The value 1619 appears 1654 times among the first 10000 terms; this is visible as a dashed horizontal line in the corresponding scatterplot.

%C The most frequent values among the first 10000000 terms are:

%C Value Number of occurrences among the first 10000000 terms

%C ------- ---------------------------------------------------

%C 283763 16934

%C 2017817 15701

%C 1619 15274

%C 55667 14706

%C 2717873 9913

%H Rémy Sigrist, <a href="/A299963/b299963.txt">Table of n, a(n) for n = 1..10000</a>

%H Rémy Sigrist, <a href="/A299963/a299963.png">Ordinal transform of the first 10000000 terms</a>

%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>

%F a(n) = A006530(A178168(n)).

%F a(2*n) = a(n) for any n > 1.

%F a(2^k) = 2 for any k > 0.

%t Table[Max[FactorInteger[#][[-1,1]]&/@NestWhileList[If[EvenQ[#],#/2,3#+1]&, n,#>1&]], {n,70}] (* _Harvey P. Dale_, Jun 22 2020 *)

%o (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)

%Y Cf. A006530, A055510, A087272, A178168.

%K nonn

%O 1,2

%A _Rémy Sigrist_, Feb 22 2018