OFFSET
1,2
COMMENTS
Because ceiling(a/b) = (a+(b-(a mod b)))/b, this sequence equals the total number of steps to reach 1 in a variant of the Collatz problem using the iteration f(x) := x/k if k divides x, x+ceiling(x/k) otherwise.
Specifically, here we set k=5 because it is the next integer (after 2) that is not in A368136; i.e. the iteration used here has no loops for starting values up to 5*5=25, apart from the loop containing 1.
It is not known if there exists n such that a(n) = -1 (either by iteration reaching a non-elementary loop which implies n>5*5, or by iteration growing without bound).
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.
OEIS Wiki, 3x+1 problem.
Wikipedia, Collatz Conjecture.
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
Giuseppe Ciacco, Feb 16 2024
STATUS
approved
