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!)
A361733 Length of the Collatz (3x + 1) trajectory from k = 10^n - 1 to a term less than k, or -1 if the trajectory never goes below k. 0
4, 7, 17, 12, 113, 17, 79, 22, 51, 33, 64, 35, 128, 56, 110, 53, 84, 128, 107, 115, 175, 82, 477, 172, 141, 182, 188, 110, 159, 167, 301, 206, 151, 146, 128, 195, 190, 299, 208, 276, 180, 185, 500, 203, 229, 190, 265, 270, 288, 252, 299, 208, 350, 348, 459, 330, 314, 268, 490, 361, 578 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
k = 10^n - 1 = A002283(n) is the repdigit consisting of n digits, all 9s.
The sequence seems to be chaotic but broadly increasing.
By contrast, repdigits of 1, 3, 5, or 7, have constant dropping times after a few initial values each.
LINKS
FORMULA
a(n) = A074473(10^n-1).
EXAMPLE
a(1) = 4 as for k = 9, the Collatz trajectory begins 9, 28, 14, 7, ...;
a(2) = 7 as for k = 99, the Collatz trajectory begins 99, 298, 149, 448, 224, 112, 56, ...;
a(3) = 17 as for k = 999, the Collatz trajectory begins 999, 2998, 1499, 4498, 2249, 6748, 3374, 1687, 5062, 2531, 7594, 3797, 11392, 5696, 2848, 1424, 712, ... .
MATHEMATICA
collatzLen[a_Integer] := Module[{len = 1, x = a},
While[x >= a, If[Mod[x, 2] > 0,
x = 3 x + 1,
x = Quotient[x, 2]
];
len++
];
Return[len]
]
PROG
(Python)
def collatz_len(a):
length = 1
x = a
while x >= a:
if x % 2 > 0:
x = 3 * x + 1
else:
x = x // 2
length += 1
return length
(PARI) f(n) = if (n%2, 3*n+1, n/2); \\ A006370
b(n) = if (n<3, return(n)); my(m=n, nb=0); while (1, m = f(m); nb++; if (m < n, return(nb+1)); ); \\ A074473
a(n) = b(10^n-1); \\ Michel Marcus, Mar 28 2023
CROSSREFS
Sequence in context: A340600 A013625 A182929 * A367744 A363642 A124402
KEYWORD
nonn
AUTHOR
Paul M. Bradley, Mar 22 2023
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 June 26 09:38 EDT 2024. Contains 373717 sequences. (Running on oeis4.)