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.

A075680 For odd numbers 2n-1, the minimum number of iterations of the reduced Collatz function R required to yield 1. The function R is defined as R(k) = (3k+1)/2^r, with r as large as possible.

This page as a plain text file.
%I A075680 #33 Apr 17 2025 14:55:27
%S A075680 0,2,1,5,6,4,2,5,3,6,1,4,7,41,5,39,8,3,6,11,40,9,4,38,7,7,2,41,10,10,
%T A075680 5,39,8,8,3,37,42,3,6,11,6,40,1,9,9,33,4,38,43,7,7,31,12,36,41,24,2,
%U A075680 10,5,10,34,15,39,15,44,8,8,13,32,13,3,37,42,42,6,3,11,30,11,18,35,6,40,23
%N A075680 For odd numbers 2n-1, the minimum number of iterations of the reduced Collatz function R required to yield 1. The function R is defined as R(k) = (3k+1)/2^r, with r as large as possible.
%C A075680 See A075677 for the function R applied to the odd numbers once. The 3x+1 conjecture asserts that a(n) is a finite number for all n. The function R applied to the odd numbers shows the essential behavior of the 3x+1 iterations.
%C A075680 Bisection of A006667. - _T. D. Noe_, Jun 01 2006
%H A075680 T. D. Noe, <a href="/A075680/b075680.txt">Table of n, a(n) for n = 1..5000</a>
%F A075680 a(n) = a(A173732(n-1) + 1) + 1 for n >= 2. - _Alan Michael Gómez Calderón_, Apr 10 2025
%e A075680 a(4) = 5 because 7 is the fourth odd number and 5 iterations are needed: R(R(R(R(R(7)))))=1.
%t A075680 nextOddK[n_] := Module[{m=3n+1}, While[EvenQ[m], m=m/2]; m]; (* assumes odd n *) Table[m=n; cnt=0; If[n>1, While[m=nextOddK[m]; cnt++; m!=1]]; cnt, {n, 1, 200, 2}]
%o A075680 (Haskell)
%o A075680 a075680 n = snd $ until ((== 1) . fst)
%o A075680             (\(x, i) -> (a000265 (3 * x + 1), i + 1)) (2 * n - 1, 0)
%o A075680 -- _Reinhard Zumkeller_, Jan 08 2014
%o A075680 (Perl)
%o A075680 sub a {
%o A075680   my $v = 2 * shift() - 1;
%o A075680   my $c = 0;
%o A075680   until (1 == $v) {
%o A075680     $v = 3 * $v + 1;
%o A075680     $v /= 2 until ($v & 1);
%o A075680     $c += 1;
%o A075680   }
%o A075680   return $c;
%o A075680 } # _Ruud H.G. van Tol_, Nov 16 2021
%o A075680 (PARI) a(n)=my(s); n+=n-1; while(n>1, n+=n>>1+1; if(n%2==0, n>>=valuation(n,2)); s++); s \\ _Charles R Greathouse IV_, Dec 22 2021
%Y A075680 Cf. A075677.
%Y A075680 Cf. A075684 for the largest number attained during the iteration.
%Y A075680 Cf. A000265.
%Y A075680 Cf. A060445 which also counts intermediate even steps.
%Y A075680 Cf. A173732.
%K A075680 easy,nonn
%O A075680 1,2
%A A075680 _T. D. Noe_, Sep 25 2002