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.

A213214 Number of steps to reach 1 in the Collatz (3x+1) problem starting with 3^n - 1.

This page as a plain text file.
%I A213214 #13 Sep 06 2015 17:56:54
%S A213214 1,3,10,9,96,95,32,31,43,42,134,133,132,131,99,98,190,189,139,138,261,
%T A213214 260,427,426,394,393,330,329,390,389,388,387,461,460,459,458,457,456,
%U A213214 455,454,453,452,500,499,498,497,496,495,494,493,492,491,746,745,488
%N A213214 Number of steps to reach 1 in the Collatz (3x+1) problem starting with 3^n - 1.
%C A213214 It is interesting to note that the quantity 3^n - 1 appears in the Collatz trajectory of 2^n - 1 after n iterations (see the formula).
%H A213214 Michel Lagneau, <a href="/A213214/b213214.txt">Table of n, a(n) for n = 1..1000</a>
%F A213214 a(n) = A193688(n) - 2*n for n > 1.
%e A213214 a(8) = 31 because A193688(8)=47, and 47 - 2*8 = 31.
%t A213214 f[n_]:=Module[{a=3^n-1, k=0}, While[a>1, k++; If[EvenQ[a], a=a/2, a=a*3+1]]; k]; Table[f[n], {n,100}]
%t A213214 Table[Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,3^n-1,#>1&]]-1,{n,100}] (* _Harvey P. Dale_, Sep 06 2015 *)
%Y A213214 Cf. A212653, A075487, A193688.
%K A213214 nonn
%O A213214 1,2
%A A213214 _Michel Lagneau_, Mar 02 2013