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.

A216022 Largest number m such that the Collatz trajectory starting at n contains all numbers not greater than m.

This page as a plain text file.
%I A216022 #22 Feb 16 2025 08:33:18
%S A216022 1,2,5,2,2,6,2,2,2,2,2,6,2,2,2,2,2,2,2,2,2,2,2,6,2,2,2,2,2,2,2,2,2,2,
%T A216022 2,2,2,2,2,2,2,2,2,2,2,2,2,6,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
%U A216022 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
%N A216022 Largest number m such that the Collatz trajectory starting at n contains all numbers not greater than m.
%C A216022 a(n) <= 6; a(A007283(n)) = 6;
%C A216022 a(n) > 1 for n > 1; a(n) <> 3; a(n) <> 4; a(n) <> 5 for n > 3;
%C A216022 a(n) = A216059(n) - 1.
%C A216022 In the first 100000 terms, there are only 16 terms greater than 2, all of which but one are equal to 6. - _Harvey P. Dale_, Nov 29 2019
%H A216022 Reinhard Zumkeller, <a href="/A216022/b216022.txt">Table of n, a(n) for n = 1..1000</a>
%H A216022 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CollatzProblem.html">Collatz Problem</a>
%H A216022 Wikipedia, <a href="http://en.wikipedia.org/wiki/Collatz_conjecture">Collatz conjecture</a>
%H A216022 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%e A216022 n = 3->10->5->16->8->4->2->1 => {1_2_3_4_5 8 10 16}, a(3) = 5;
%e A216022 n = 4->2->1 => {1_2 4}, a(4) = 2;
%e A216022 n = 5->16->8->4->2->1 => {1_2 4 5 8 16}, a(5) = 2;
%e A216022 n = 6->3->10->5->16->8->4->2->1 => {1_2_3_4_5_6 8 10 16}, a(6) = 6.
%t A216022 scoll[n_]:=Sort[NestWhileList[If[EvenQ[#],#/2,3#+1] &,n,#>1 &]]; Join[{1,2},Table[i=1; While[scoll[n][[i]]==i,i++]; i-1,{n,3,86}]] (* _Jayanta Basu_, May 27 2013 *)
%t A216022 Join[{1,2},Flatten[Table[Position[Differences[Sort[ NestWhileList[ If[ EvenQ[#],#/2,3#+1]&,n,#>1&]]], _?(#>1&),1,1],{n,90}]]] (* _Harvey P. Dale_, Nov 29 2019 *)
%o A216022 (Haskell)
%o A216022 import Data.List (sort)
%o A216022 a216022 = length .
%o A216022    takeWhile (== 0) . zipWith (-) [1..] . sort . a070165_row
%Y A216022 Cf. A006370, A070165.
%K A216022 nonn
%O A216022 1,2
%A A216022 _Reinhard Zumkeller_, Sep 01 2012