Let $M \ge 2$. Inspired by the Collatz iteration / algorithm ($M=2$), I tried the following function:
$$C_M(n) = n/M, \text{ if } n \equiv 0 \mod M, \text{ otherwise } (M+1)n+\{(M-n) \mod M \}$$
We might view, unproven, the Collatz iteration, as an algorithm to solve the following diophantine equation:
$$\forall n \in \mathbb{N} \exists x,y,s,l \in \mathbb{N}_0: xM^s = (M+1)^l n + y$$
and
$$s+l = \text{ stopping time until first duplicate value in a cycle is detected }$$
If the Collatz iteration stops at the number $c$ because the next value would be a duplicate in the iteration, then:
$$ c = \frac{a}{\hat{a}}n + \frac{b}{\hat{b}}$$
and my claim is that :
$$xM^s = c \operatorname{lcm}(\hat{a},\hat{b})$$
$$(M+1)^l = \frac{ \operatorname{lcm}(\hat{a},\hat{b})a}{\hat{a}}$$
and
$$y = \frac{ \operatorname{lcm}(\hat{a},\hat{b})b}{\hat{b}}$$
Where can I read more about this equation above and the connection to Collatz conjecture?
Thanks for your help.
Here ist some experimental Sage code to try out this idea.
Example:
15
> 15
> 126
> 18
> 147
> 21
> 3
> 28
> 4
> 35
> 5
> 42
> 6
> 49
> 7
> 1
> 14
> 2
[(1, 0), (8, 6), (8/7, 6/7), (64/7, 69/7), (64/49, 69/49), (64/343, 69/343), (512/343, 1924/343), (512/2401, 1924/2401), (4096/2401, 22595/2401), (4096/16807, 22595/16807), (32768/16807, 214374/16807), (32768/117649, 214374/117649), (262144/117649, 1832641/117649), (262144/823543, 1832641/823543), (262144/5764801, 1832641/5764801), (2097152/5764801, 49249934/5764801), (2097152/40353607, 49249934/40353607)]
len= 17
2097152/40353607 49249934/40353607 2
M = 7 N = 8 n = 15 x*M^s = 2 * 7^9 N^l = 2^21 y = 49249934