A Collatz generalization and approximation of a bounded-unbounded point of Collatz-like Functions
I have been working on Collatz-like functions to test the probabilistic heuristic argument in favor of all trajectories being bounded (ending in a cycle) and have come up with a generalization to test this argument empirically. This leads me to two questions.
Let $f:\mathbb{N} \to\mathbb{N}$. The Collatz function states that the following iterated map will eventually equal to 1:
$$f(n) = \begin{cases} n/2, & \text{if}\ 2\mid n\\ 3n+1, & \text{otherwise} \\ \end{cases}$$
My generalization is as follows: Let $G:\mathbb{R} \to\mathbb{Z}$ defined as
$$G(x) = \begin{cases} x/2, & \text{if}\ 2\mid x\\ 2\lceil ax \rceil, & \text{otherwise} \\ \end{cases}$$
where $a, x \in \mathbb{R}$. The Collatz function is the case when $a = 1.5$. Likewise, the $5n+1$ problem is the case when $a=2.5$.
I conjecture in line with the heuristic argument that if $-2 \leq a \leq 2$ then for any $x_0$, repeated iteration of $G$ on $x_0$ will yield a bounded trajectory. However, if $a>2$ or $a<-2$, for some $x_0$, repeated iteration of $G$ on $x_0$ will yield an unbounded trajectory. Note, $G(x)$ is bounded if for all $x_0$ we end in a cycle whereas unbounded means that G has at least one trajectory that diverges to infinity.
-
Is this a known generalization of the Collatz function? I have check as much as I could and found only discontinuous generalizations such as 1, 2, and 3. On the other hand, $G(x)$ is continuous in the sense that it allows for both $x$ and $a$ to be any real numbers. Having this flexibility provides a way to test the probabilistic heuristic argument in favor of bounded trajectories by varying $a$ as close to 2 as possible, i.e. if $log(|a|) + log(1/2) < 0$, then for all $x_0$, iterations of $G(x)$ on $x_0$ will yield a cycle.
-
The function $H$ below is more global than $G$. Empirically, a bounded-unbounded point seems to exist for $H$ somewhere in the range $c \leq 2b^2$. Is there a better way to approximate the bounded-unbounded point for the generalization $H$ than testing different values of $c$ for a given value of $b$.
$$H(x) = \begin{cases} \frac{x}{b}, & \text{if}\ b\mid x\\ b\lceil \frac{cx}{b^2} \rceil, & \text{otherwise} \\ \end{cases}$$ where $b,c \in \mathbb{N}$. The Collatz function is when $b = 2$ and $c = 6$.
Using Excel, when $b=3$, for $c \leq 16$, H appears bounded for all $x$ but for $c \geq 17$ it appears unbounded. Similarly, when $b = 5$, for $c \leq 35$, H appears bounded for all $x$ but for $c \geq 36$ it appears unbounded. For $b=7$ the demarcation point appears to be $c=65$. Taking the ratio $\frac{c_{max}}{b^2}$ where $c_{max}$ is the bounded-unbounded demarcation point, gives
$\frac{c_{max}}{b^2}=2.0$ when $b = 2$
$\frac{c_{max}}{b^2}=1.8$ when $b = 3$
$\frac{c_{max}}{b^2}=1.5$ when $b = 4$
$\frac{c_{max}}{b^2}=1.4$ when $b = 5$
$\frac{c_{max}}{b^2}=1.4$ when $b = 6$
$\frac{c_{max}}{b^2}=1.3$ when $b = 7$
Seems that as $b \to \infty$ then, $\frac{c_{max}}{b^2}\to1$.
Any help will be greatly appreciated.
According to request of the asker, here is some Pari/GP -code, partly function-definitions, partly experimenting to get list of results.
\\ test collatz with *real* bases for existence of cycles and/or divergence
\\ https://math.stackexchange.com/questions/4340764/a-collatz-generalization-and-approximating-the-bounded-unbounded-point-of-collat
\\ example set global variable "base" to some example value:
base=9/4
g(x)=if(! (x % 2),x/2,2*ceil(base*x))
\\ alternative. g1(x) works on and produces only odd numbers. May be more
\\ efficient
g1(x)=my(A);A=valuation(x,2);x>>=A;x=2*ceil(base*x);A=valuation(x,2);x>>=A
\\ print 800 steps of iterations, distributed over 5 columns ("msep(...,5)"),
\\ beginning at a0=19 ("msep()" is user defined function)
printp( msep(Mat(vectorv(800,r,if(r==1,a0=19,a0=g(a0)))),5))
\\ print the same, with a0=86, in one column but showing the index as well:
for(k=1,800,if(k==1,a0=86,a0=g(a0));if(a0==86,print([k,a0])))
\\ print 800 steps of iterations, distributed over 10 columns,
\\ beginning at a0=19 ("msep()" is user defined function)
\\ we see, that a0=19 is not itself cyclic! but g(19)=86 is!
printp(msep(Mat(vectorv(800,r,if(r==1,a0=19,a0=g(a0)))),10))
Here we use two example bases, and call a loop, which checks for cycles in $a_0=1..999$ (only odd $a_0$) and cycle-lengthes of at most $10\,000$ iterations steps:
fmt(2000);base=sqrt(5);fmt(200) \\ use another base. Take care, that
\\ over many iterations numbers with many digits shall occur; choose
\\ accordingly *big* decimal precision! (here 2000 dec digits)
fmt(2000);base=Pi-1;fmt(200)
\\ or try this base near 2
\\ a loop to find cycles and protocol them:
{print("Base:",base);cyclist=List();
forstep(a0=1,999,2,
dir=Map();
a1=a2=a0;found=0;ix1=ix2=0;mapput(dir,a1,0);
for(k=1,10000, \\ test for cycles with length up to 10 000
a1=g1(a1); \\ use g1() to document only odd steps
if(!mapisdefined(dir,a1,&ix1),mapput(dir,a1,k);next());
a2=a1;found=ix2=k;break();
);
if(!found, listput(cyclist,Str(a0," --- nothing found"));next());
\\ find minimal element of the found cycle
len=ix2-ix1; mina1=a1;for(k=1,len,a1=g1(a1);mina1=min(a1,mina1));
\\ document the parameters for this a0, be it cycle or not:
listput(cyclist,
strprintf("%3d : %3d-->%3d cyclen:%3d enter cyc at val:%4d at pos:%3d \n",a0,mina1,mina1,len,a2,ix1));
next();
);
cyclist=Mat(Col(cyclist)); \\ convert "cyclist" from Map to Mat
printp(cyclist[1..8,]) } \\ show the first 8 entries.
This gave the following protocol (base = $\pi-1$). Only odd numbers were documented (using function $g_1(x)$) :
1 : 3--> 3 cyclen: 8 enter cyc at val: 3 at pos: 1 \n
3 : 3--> 3 cyclen: 8 enter cyc at val: 3 at pos: 0 \n
5 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 1 \n
7 : 3--> 3 cyclen: 8 enter cyc at val: 7 at pos: 0 \n
9 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 2 \n
11 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 0 \n
13 : 3--> 3 cyclen: 8 enter cyc at val: 7 at pos: 1 \n
15 : 3--> 3 cyclen: 8 enter cyc at val: 15 at pos: 0 \n
17 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 3 \n
19 : 3--> 3 cyclen: 8 enter cyc at val: 41 at pos: 1 \n
21 : 3--> 3 cyclen: 8 enter cyc at val: 7 at pos: 4 \n
23 : 63--> 63 cyclen: 10 enter cyc at val: 63 at pos: 4 \n
25 : 63--> 63 cyclen: 10 enter cyc at val: 63 at pos: 3 \n
27 : 63--> 63 cyclen: 10 enter cyc at val: 63 at pos: 2 \n
29 : 63--> 63 cyclen: 10 enter cyc at val: 63 at pos: 1 \n
31 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 4 \n
33 : 3--> 3 cyclen: 8 enter cyc at val: 33 at pos: 0 \n
35 : 63--> 63 cyclen: 10 enter cyc at val:1639 at pos: 46 \n
37 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 2 \n
39 : 3--> 3 cyclen: 8 enter cyc at val: 7 at pos: 5 \n
41 : 3--> 3 cyclen: 8 enter cyc at val: 41 at pos: 0 \n
43 : 63--> 63 cyclen: 10 enter cyc at val: 63 at pos: 5 \n
45 : 3--> 3 cyclen: 8 enter cyc at val: 7 at pos: 3 \n
47 : 3--> 3 cyclen: 8 enter cyc at val: 33 at pos: 25 \n
49 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 18 \n
51 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 7 \n
53 : 3--> 3 cyclen: 8 enter cyc at val: 33 at pos: 3 \n
55 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 6 \n
57 : 3--> 3 cyclen: 8 enter cyc at val: 33 at pos: 2 \n
59 : 3--> 3 cyclen: 8 enter cyc at val: 11 at pos: 5 \n
61 --- nothing found
63 : 63--> 63 cyclen: 10 enter cyc at val: 63 at pos: 0 \n
65 : 63--> 63 cyclen: 10 enter cyc at val:1639 at pos: 47 \n
...
and this is the version using $g(x)$ which allows to display even values in the orbit (which also means, the documented cycle-lengthes are longer than with $g_1(x)$):
3 : 3--> 3 cyclen: 25 enter cyc at val: 3 at pos: 0 \n
5 : 3--> 3 cyclen: 25 enter cyc at val: 22 at pos: 1 \n
7 : 3--> 3 cyclen: 25 enter cyc at val: 7 at pos: 0 \n
9 : 3--> 3 cyclen: 25 enter cyc at val: 22 at pos: 5 \n
11 : 3--> 3 cyclen: 25 enter cyc at val: 11 at pos: 0 \n
13 : 3--> 3 cyclen: 25 enter cyc at val: 14 at pos: 3 \n
15 : 3--> 3 cyclen: 25 enter cyc at val: 15 at pos: 0 \n
17 : 3--> 3 cyclen: 25 enter cyc at val: 22 at pos: 9 \n
19 : 3--> 3 cyclen: 25 enter cyc at val: 82 at pos: 1 \n
21 : 3--> 3 cyclen: 25 enter cyc at val: 14 at pos: 13 \n
23 : 63--> 63 cyclen: 31 enter cyc at val: 126 at pos: 10 \n
25 : 63--> 63 cyclen: 31 enter cyc at val: 126 at pos: 7 \n
27 : 63--> 63 cyclen: 31 enter cyc at val: 126 at pos: 4 \n
29 : 63--> 63 cyclen: 31 enter cyc at val: 126 at pos: 1 \n
31 : 3--> 3 cyclen: 25 enter cyc at val: 22 at pos: 13 \n
33 : 3--> 3 cyclen: 25 enter cyc at val: 33 at pos: 0 \n
35 : 63--> 63 cyclen: 31 enter cyc at val:3278 at pos:136 \n
37 : 3--> 3 cyclen: 25 enter cyc at val: 22 at pos: 7 \n
39 : 3--> 3 cyclen: 25 enter cyc at val: 14 at pos: 17 \n
41 : 3--> 3 cyclen: 25 enter cyc at val: 41 at pos: 0 \n
43 : 63--> 63 cyclen: 31 enter cyc at val: 126 at pos: 14 \n
45 : 3--> 3 cyclen: 25 enter cyc at val: 14 at pos: 11 \n
47 : 3--> 3 cyclen: 25 enter cyc at val: 66 at pos: 77 \n
49 : 3--> 3 cyclen: 25 enter cyc at val: 22 at pos: 57 \n
51 : 3--> 3 cyclen: 25 enter cyc at val: 22 at pos: 23 \n
53 : 3--> 3 cyclen: 25 enter cyc at val: 66 at pos: 9 \n
55 : 3--> 3 cyclen: 25 enter cyc at val: 22 at pos: 20 \n
57 : 3--> 3 cyclen: 25 enter cyc at val: 66 at pos: 6 \n
59 : 3--> 3 cyclen: 25 enter cyc at val: 22 at pos: 17 \n
61 --- nothing found
63 : 63--> 63 cyclen: 31 enter cyc at val: 63 at pos: 0 \n
65 : 63--> 63 cyclen: 31 enter cyc at val:3278 at pos:140 \n
...