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!)
A346369 a(n) is the number of steps the Collatz trajectory of -n takes to reach a cycle, or -1 if no cycle is ever reached. 0
0, 0, 3, 1, 0, 4, 0, 2, 7, 0, 5, 5, 5, 0, 8, 3, 0, 8, 3, 0, 6, 6, 1, 6, 0, 6, 3, 1, 9, 9, 4, 4, 11, 0, 9, 9, 0, 4, 12, 1, 0, 7, 7, 7, 5, 2, 12, 7, 9, 0, 7, 7, 15, 4, 0, 2, 28, 10, 10, 10, 0, 5, 15, 5, 36, 12, 3, 0, 18, 10, 18, 10, 7, 0, 5, 5, 13, 13, 13, 2, 18 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
The analog of A139399 for negative starting values.
Is a(n) > -1 for all n?
LINKS
FORMULA
a(n) = A224166(n) - A224254(n) = 1 + A224183(n) - A224254(n). - Pontus von Brömssen, Jul 24 2021
EXAMPLE
For n = 5: The trajectory of -5 starts -5, -14, -7, -20, -10, -5, -14, -7, -20, -10, -5, ..., with -5 already being part of the cycle {-5, -14, -7, -20, -10}, so a(5) = 0.
For n = 6: The trajectory of -6 starts -6, -3, -8, -4, -2, -1, -2, -1, -2, -1, -2, ..., reaching a term of the cycle {-2, -1} after 4 steps, so a(6) = 4.
PROG
(PARI) a006370(n) = if(n%2==0, n/2, 3*n+1)
trajectory(n, terms) = my(v=[n]); while(#v < terms, v=concat(v, a006370(v[#v]))); v
a(n) = my(t, v=[]); for(k=1, oo, t=trajectory(-n, k); for(x=1, #t, if(x < #t && t[x]==t[#t], return(x-1))))
CROSSREFS
Sequence in context: A285123 A159059 A340262 * A127569 A117372 A127570
KEYWORD
sign
AUTHOR
Felix Fröhlich, Jul 14 2021
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 July 16 14:52 EDT 2024. Contains 374349 sequences. (Running on oeis4.)