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.

A337144 n is the a(n)-th positive integer which takes its number of steps to reach 1 in the Collatz (or 3x+1) problem.

This page as a plain text file.
%I A337144 #24 Jan 18 2025 15:23:43
%S A337144 1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1,2,2,3,1,2,1,1,2,1,1,2,3,1,2,1,1,
%T A337144 2,1,2,3,1,2,1,3,1,2,3,4,1,1,1,2,3,2,3,1,2,2,1,3,2,4,5,1,2,2,1,2,3,2,
%U A337144 3,4,1,1,1,2,5,3,4,1,2,3,5,1,2,4,5,1,2
%N A337144 n is the a(n)-th positive integer which takes its number of steps to reach 1 in the Collatz (or 3x+1) problem.
%H A337144 Alois P. Heinz, <a href="/A337144/b337144.txt">Table of n, a(n) for n = 1..65536</a>
%H A337144 Wikipedia, <a href="https://en.wikipedia.org/wiki/Collatz_conjecture">Collatz Conjecture</a>
%H A337144 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%F A337144 Ordinal transform of A006577.
%F A337144 a(n) = |{ j in {1..n} : A006577(j) = A006577(n) }|.
%e A337144 a(13) = 2 because A006577(13) = A006577(12) = 9 != A006577(j) for j < 12.
%p A337144 collatz:= proc(n) option remember; `if`(n=1, 0,
%p A337144    1 + collatz(`if`(n::even, n/2, 3*n+1)))
%p A337144 end:
%p A337144 b:= proc() 0 end:
%p A337144 a:= proc(n) option remember; local t;
%p A337144      `if`(n=1, 0, a(n-1));
%p A337144       t:= collatz(n); b(t):= b(t)+1
%p A337144     end:
%p A337144 seq(a(n), n=1..120);
%t A337144 collatz[n_] := collatz[n] = If[n == 1, 0,
%t A337144    1 + collatz[If[EvenQ[n], n/2, 3n+1]]];
%t A337144 b[_] = 0;
%t A337144 a[n_] := a[n] = Module[{t},
%t A337144    If[n == 1, 0, a[n-1]];
%t A337144    t = collatz[n]; b[t] = b[t]+1];
%t A337144 Array[a, 120] (* _Jean-François Alcover_, Jan 29 2021, after _Alois P. Heinz_ *)
%Y A337144 Cf. A005186, A006577, A380244.
%K A337144 nonn,look
%O A337144 1,13
%A A337144 _Alois P. Heinz_, Jan 27 2021