A370350 Number of steps to go from n to 1 in a variant of the Collatz iteration x -> (x / 5 if 5 divides x, x + (x+(5-(x mod 5)))/5 otherwise), or -1 if 1 is never reached.
0, 4, 3, 2, 1, 7, 17, 6, 16, 5, 15, 5, 5, 14, 4, 4, 13, 11, 11, 3, 12, 10, 10, 20, 2, 11, 9, 9, 19, 8, 69, 10, 8, 8, 18, 17, 18, 68, 9, 7, 7, 8, 77, 16, 17, 67, 8, 17, 8, 6, 7, 76, 15, 7, 16, 66, 7, 16, 7, 6, 75, 6, 75, 14, 6, 6, 16, 65, 6, 15, 6, 15, 24, 74
Offset: 1
Examples
For n = 11, the following trajectory is obtained: 11, 14, 17, 21, 26, 32, 39, 47, 57, 69, 83, 100, 20, 4, 5, 1 which requires 15 steps to reach 1, therefore a(11) = 15.
Links
- Giuseppe Ciacco, Table of n, a(n) for n = 1..10000
- Walter Carnielli, Some natural generalizations of the Collatz Problem, Applied Mathematics E-Notes 15 (2015): 207-215.
- Wikipedia, Collatz Conjecture.
- OEIS Wiki, 3x+1 problem.
Programs
-
Mathematica
s={};Do[c=0;a=n;While[a>1,If[Divisible[a,5],a=a/5,a=a+Ceiling[a/5]];c++];AppendTo[s,c],{n,74}];s (* James C. McMahon, Feb 28 2024 *)
-
Python
def a(n, C = 5): s = 0 while n > 1: d, r = divmod(n, C) n = n + 1 + d if r else d s += 1 return s print([a(n) for n in range(1, 75)]) # Giuseppe Ciacco and Robert Munafo, Mar 25 2024
Comments