login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A221956 Number of values in the Collatz (3x+1) trajectory starting at n that are also present in the trajectory for some k < n. 2
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, 19, 19, 18, 107, 6, 24, 14, 14, 21, 19, 22, 23, 9, 110, 8, 22, 17, 14, 17, 105, 11, 25, 25, 20, 12, 12, 112, 106, 20, 30, 20, 33, 19, 20, 108, 95, 7, 28, 27, 28, 15, 12 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
EXAMPLE
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.
MAPLE
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:
MATHEMATICA
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 *)
CROSSREFS
Sequence in context: A282940 A193909 A211603 * A249549 A193905 A127293
KEYWORD
nonn,look
AUTHOR
Michel Lagneau, Feb 23 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 18:04 EDT 2024. Contains 372340 sequences. (Running on oeis4.)