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.

A213672 Final term in Collatz trajectory of n that did not appear in previous trajectories.

Original entry on oeis.org

1, 2, 4, 0, 0, 6, 20, 0, 14, 0, 0, 12, 0, 0, 80, 0, 0, 18, 44, 0, 32, 0, 0, 24, 38, 0, 92, 0, 0, 30, 0, 0, 50, 0, 0, 36, 56, 0, 152, 0, 0, 42, 74, 0, 68, 0, 0, 48, 0, 0, 116, 0, 0, 54, 188, 0, 86, 0, 0, 60, 0, 0, 728, 0, 0, 66, 0, 0, 104, 0, 0, 72, 110, 0, 128, 0
Offset: 1

Views

Author

Jayanta Basu, Mar 03 2013

Keywords

Comments

This can be considered as the step down value, as beyond this point the trajectory of n reduces to a lower trajectory. When n is impure we define a(n)=0; see also A177729.

Examples

			a(7)=20 because after 20 trajectory of 7 becomes identical with trajectory of 3.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; prev = {}; Table[c = Collatz[n]; If[Complement[c, prev] == {}, 0, i = 1; While[MemberQ[prev, c[[-i]]], i++]; prev = Union[prev, c]; c[[-i]]], {n, 100}] (* T. D. Noe, Mar 03 2013 *)