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.
%I A006460 M0304 #32 Aug 08 2022 15:54:08 %S A006460 1,2,2,4,4,4,2,1,2,1,4,1,1,4,4,2,1,4,4,2,2,1,1,2,4,2,1,1,1,1,2,4,4,2, %T A006460 2,1,1,1,2,4,2,4,4,2,2,2,4,4,1,1,1,4,4,2,2,2,4,2,4,2,2,4,4,1,1,1,1,4, %U A006460 4,4,1,2,2,2,4,2,2,4,4,1,2,4,4,1,1,1,1,4,1,4,4,4,4,1,1,1,2,2,2,2,2,2,1,1,4 %N A006460 Image of n after 3k iterates of '3x+1' map (k large). %D A006460 R. K. Guy, Unsolved Problems in Number Theory, E16. %D A006460 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A006460 Reinhard Zumkeller, <a href="/A006460/b006460.txt">Table of n, a(n) for n = 1..10000</a> %H A006460 M. Elia, <a href="/A006460/a006460.pdf">Letter to N. J. A. Sloane, Jun. 1981</a> %H A006460 J. C. Lagarias, <a href="http://www.cecm.sfu.ca/organics/papers/lagarias/paper/html/paper.html">The 3x+1 problem and its generalizations</a>, Amer. Math. Monthly, 92 (1985), 3-23. %H A006460 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %F A006460 For n > 2: a(n) = 4 if L = 0, otherwise L, where L = A139399(n) mod 3. - _Reinhard Zumkeller_, Nov 16 2013 %t A006460 f[n_] := If[EvenQ[n], n/2, 3 n + 1]; %t A006460 a[n_] := With[{ff = NestWhileList[f, n, {#1, #2, #3} != {4, 2, 1}&, 3]}, ff[[Switch[Mod[Length[ff], 3], 0, -3, 1, -1, 2, -2]]]]; %t A006460 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Aug 08 2022 *) %o A006460 (Haskell) %o A006460 a006460 = f 0 where %o A006460 f k x | mod k 3 == 0 && x `elem` [1, 2, 4] = x %o A006460 | otherwise = f (k+1) (a006370 x) %o A006460 -- _Reinhard Zumkeller_, Nov 16 2013 %Y A006460 Cf. A006370, A076052 (partial sums), A139399. %K A006460 nonn,nice %O A006460 1,2 %A A006460 _N. J. A. Sloane_ %E A006460 More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001