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.

A028394 Iterate the map in A006369 starting at 8.

Original entry on oeis.org

8, 11, 15, 10, 13, 17, 23, 31, 41, 55, 73, 97, 129, 86, 115, 153, 102, 68, 91, 121, 161, 215, 287, 383, 511, 681, 454, 605, 807, 538, 717, 478, 637, 849, 566, 755, 1007, 1343, 1791, 1194, 796, 1061, 1415, 1887, 1258, 1677, 1118, 1491, 994, 1325, 1767, 1178
Offset: 0

Views

Author

Keywords

Comments

It is an unsolved problem to determine if this sequence is bounded or unbounded.

References

  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 270.

Crossrefs

Programs

  • Haskell
    a028394 n = a028394_list !! n
    a028394_list = iterate a006369 8  -- Reinhard Zumkeller, Dec 31 2011
  • Maple
    G := proc(n) option remember; if n = 0 then 8 elif 4*G(n-1) mod 3 = 0 then 2*G(n-1)/3 else round(4*G(n-1)/3); fi; end; [ seq(G(i),i=0..80) ];
    f:=proc(N) local n;
    if N mod 3 = 0 then 2*(N/3);
    elif N mod 3 = 2 then 4*((N+1)/3)-1; else
    4*((N+2)/3)-3; fi; end; # N. J. A. Sloane, Feb 04 2011
  • Mathematica
    nxt[n_]:=Module[{m=Mod[n,3]},Which[m==0,(2n)/3,m==1,(4n-1)/3,True,(4n+1)/3]]; NestList[nxt,8,60] (* Harvey P. Dale, Dec 13 2013 *)
    SubstitutionSystem[{n_ :> Switch[Mod[n, 3], 0, 2n/3, 1, (4n-1)/3, , (4n+1)/3 ] }, {8}, 60] // Flatten (* _Jean-François Alcover, Mar 01 2019 *)

Formula

The map is: n -> if n mod 3 = 0 then 2*n/3 elif n mod 3 = 1 then (4*n-1)/3 else (4*n+1)/3.