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.

A221956 Number of values in the Collatz (3x+1) trajectory starting at n that are also present in the trajectory for some k < n.

This page as a plain text file.
%I A221956 #35 Dec 12 2022 20:52:52
%S A221956 0,1,2,3,6,8,7,4,17,7,15,9,10,18,9,5,13,20,16,8,5,16,16,10,21,11,17,
%T A221956 19,19,18,107,6,24,14,14,21,19,22,23,9,110,8,22,17,14,17,105,11,25,25,
%U A221956 20,12,12,112,106,20,30,20,33,19,20,108,95,7,28,27,28,15,12
%N A221956 Number of values in the Collatz (3x+1) trajectory starting at n that are also present in the trajectory for some k < n.
%H A221956 Michel Lagneau, <a href="/A221956/b221956.txt">Table of n, a(n) for n = 1..10000</a>
%H A221956 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%e A221956 a(15) = 9 because the Collatz trajectory starting at 15 is (15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1), which has 9 values, namely, 40, 20, 10, 5, 16, 8, 4, 2, and 1, in common with the trajectory for at least one k < 15.
%p A221956 lst1:={1}: L:={1}:for n from 2 to 200 do: x := n :lst:={n}:while x > 1 do if type(x, 'even') then x := x/2:lst:=lst union {x}:  else x := 3*x+1 : lst:=lst union {x}: end if; end do;lst2:=L intersect lst:n2:=nops(lst2 ): printf(`%d, `,n2): L:=L union lst:od:
%t A221956 Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; found = {}; Table[c = Collatz[n]; r = Intersection[c, found]; found = Union[found, c]; Length[r], {n, 100}] (* _T. D. Noe_, Feb 23 2013 *)
%Y A221956 Cf. A006577, A222118.
%K A221956 nonn,look
%O A221956 1,3
%A A221956 _Michel Lagneau_, Feb 23 2013