1

Given the Collatz function and its iterates: $$ T(n) = \begin{cases} n/2, & \text{if $n$ is even} \\ (3n+1)/2, & \text{if $n$ is odd} \end{cases} $$ and $$ T^{k}(n) = T(T^{k-1}(n)).$$

Question. How does one apply iterates to large integers such as $$ n = \big(3756801695685 \; \times \;2^{666669}\big) – 1\: ?\label{1}\tag{1} $$

We can begin by observing that repeated application of the Collatz function to numbers of the form $$ m = (2^{k} \times p) – 1 $$

where p is an odd integer, results in the iterate:

$$ T^{k}(m) = ((3^{k} \times p) – 1), $$

Thus, the trajectory of m travels k steps to arrive at a step that is $(3/2)^{k}$ times greater than m.

Applying this to the example in \eqref{1} yields a trajectory that spans 666669 consecutive odd numbers to arrive at

$$ T^{666669}(n) = \big(3756801695685 \times 3^{666669}-1\big). \label{2}\tag{2} $$

NOTE:

$$ 3756801695685 = 3 \times 5 \times 43 \times 347 \times 16785299 $$

Rephrasing the question: Are there similar ways to shortcut the evaluation of remaining iterates?

  • 2
    This value is even, so divide by $2$. Is the result of that even? No, because $3756801695685\cdot 3^{666669}\equiv 3\pmod 4$. How else do you think we continue? This is why Collatz is hard - because there isn't a clear pattern, so you have to proceed case-by-case. – Thomas Andrews Feb 07 '16 at 06:30
  • I prefer to think that patterns exist but are as yet undiscovered. – frogfanitw Feb 07 '16 at 08:03
  • 1
    Depends on what the definitions of "pattern" and "exist" are. :) In any event, that doesn't answer the question of what type of answer you are looking for other than the definition of the function $T$. – Thomas Andrews Feb 07 '16 at 13:45
  • You might find it interesting that not only numbers of the form $2^k \cdot p -1$ (with sufficient high $k$) have this feature to increase to the form $3^k \cdot p -1$ but also numbers of the form $2^k \cdot p -5$ and/or $2^k \cdot p -7$ go to $3^k \cdot p -5$ and/or $3^k \cdot p -7$ and similarly one more of these nice patterns can be described with the initial residue $-17$ : the reason is, that in the negative integers, $-1$ forms a one-step-loop, $-5,-7$ a two-step-loop and $-17,...$ a 7-step loop (the latter is from the top of my head, no guarantee for the number of steps until cycling) – Gottfried Helms Feb 07 '16 at 17:26
  • @ThomasAndrews My question is partly how to simplify the expressions, so I appreciate the comments and answer received thus far and will study them. My motivation for the question is that applying Collatz to large integers with known properties may be of interest. In this case the large integer is the first of a pair of twin primes. – frogfanitw Feb 08 '16 at 06:13
  • 1
    @GottfriedHelms Thanks, I'm sure the $2^k \cdot p -5$ loop will help with T[n+2} (the other twin prime). – frogfanitw Feb 08 '16 at 07:39
  • The given number (with the term $\small 3^{666669}$) can be handled in Pari/GP, it has about 318095 decimal digits - and is internal in binary representation. From this we need (in principle) only remove the trailing binary zeros to compute the next iterate. The first and last digits of $\small {375... 685\cdot 3^{666669}-1 \over 2}$ are $\small 167321202936474 .... 4706927$ – Gottfried Helms Feb 08 '16 at 16:49
  • 1
    @GottfriedHelms so Pair/GP is the tool to use to perform the iterates when that can't be avoided by pattern recognitions. Thanks! – frogfanitw Feb 09 '16 at 13:13

3 Answers3

1

$\forall k, \forall \alpha \in \mathbb{N}:$

  • $T^k(\alpha\,2^k) = \alpha$
  • $T^k(\alpha\,2^k + 2^k - 1) = \alpha\,3^k + 3^k - 1\quad\equiv \alpha\ (\text{mod } 2)$

So $T^{k+1}(\alpha\,2^{k+1} + 2^k - 1) = \alpha\,3^k + \frac{3^k - 1}{2}\quad\equiv \alpha + k\ (\text{mod } 2)$

After that, I have some relations, but less general.

These formulas can be proved by induction. But with a mixed representation in base 2 and 3, these formulas become obvious. Because

  • $(1)_2:(1)_3 = 4 = (2)_3:(0)_2$
  • $(1)_2:(2)_3 = 5 = (2)_3:(1)_2$
  • $(0)_2:(2)_3 = 2 = (1)_3:(0)_2$

Where $(\dots)_2$ is a binary representation and $(\dots)_3$ a representation in base $3$. Something like $\alpha:(0101)_2:(2)_3$ represents $\alpha \times 2^4 \times 3 + (0101)_2 \times 3 + (2)_3 = \alpha \times 2^4 \times 3 + 5 \times 3 + 2 = \alpha \times 2^4 \times 3 + 17$. And it is possible to mix figures in base 2 and figures in base 3.

(A little online tool to manipulate this kind of mixed radix.)

$\forall k, \forall \alpha \in \mathbb{N}:$

  • $T\big(\alpha:(0)_2\big) = \alpha$
  • $T\big(\alpha:(1)_2\big) = \alpha:(2)_3$
  • $T^k\big(\alpha:(\underbrace{0\dots00}_{k\text{ times}})_2\big) = \alpha$
  • $T^k\big(\alpha:(\underbrace{1\dots11}_{k\text{ times}})_2\big) = \alpha:(\underbrace{2\dots22}_{k\text{ times}})_3\quad\equiv \alpha\ (\text{mod } 2)$

So $T^{k+1}\big(\alpha:(0\underbrace{1\dots11}_{k\text{ times}})_2\big) = \alpha:(\underbrace{1\dots11}_{k\text{ times}})_3\quad\equiv \alpha + k\ (\text{mod } 2)$

1

For people liking examples with big numbers...

Another general rule for numbers dumping down the greatest numbers ... $$ a_0 = 2^A \cdot 2k + {2^A-1\over 3} \to a_1 = 6k+1 \qquad \text{for even }A \\ a_0=2^A \cdot 2k + {5 \cdot 2^A-1\over 3} \to a_1=6k+5 \qquad \text{for odd }A \\ $$ and arbitrary integer $k$.

Example with a small number: let $A=2$ then

A=2
k=15

r = (2^A-1)/3
r:
  1
print(a0=2^A*2*k+r," -> ",a1=6*k+1)
a0:
 121
  -> 
a1:
 91

Example with a big number: let $A=2000$ then

A=2000
k=15

r = (2^A-1)/3 
r: 
38271023175808484141094440039256066134077256736289840015921424560858875379 \   
7456771285553162105502089972815321546329154257815706320287685110475310452055 \   
5510617970999638177076000022959304941334829047630899668782874826053848788212 \   
9454649105675346822117990301665519387466269648209868541103883178721407323444 \   
2271147229696614861685341264949359713529669782588334763342389022086101740027 \   
1074542709725375596110573553299846547270900725995280134738661772775051362981 \   
1300697306851652594529890679720027319072210194251793475194575338509449595473 \   
144018169638425261294208391811842933607614256939321817920728283716343125


print(a0=2^A*2*k+r,   " -> "  , a1=6*k+1)
a0: 
34826631089985720568395940435723020182010303630023754414488496350   \
381576595568566186985337751600690187526194260715953037461229275146  \
179345053253251137055146623536096707411391600208929674966146944333  \
441186985924160917090023972737803730686164565608127371174515622642  \
594305379870980372404533692636480664334246674397902391952413366055  \
110391733931199950215538463464157401009835258342466778338658500917  \
924606219335028603580165196606557049226121822132252967403128283634  \
549235003861022200518545224860355711276769132062427063558043599131  \
880561056534370966987777729636548777069582928973814782854307862738  \
18187224405
     -> 
a1: 91
1

For the general problem it seems to me the following is the most useful property when looking at big numbers of a certain structure.
Let $a_0 = r $ be an odd number, then $ a_1 = {3a_0+1 \over 2^A} $ where $A$ is the exponent of the primefactor $2$ in $3a_0+1$.

Now consider $b_0 = 2^M\cdot x + r $ where $M$ is large, at least larger than $A$. Then $$ b_1={3b_0+1 \over 2^A} ={ 3\cdot 2^M\cdot x + 3r+1 \over 2^A} = 3\cdot 2^{M-A}\cdot x +{ 3r+1 \over 2^A} = 3\cdot 2^{M-A}\cdot x + a_1 $$ That means, we can use any $b_0$ as large as we like and which is $a_0 + 2^Mx $ with $x$ odd and $M$ greater than $A$ and compute easily $b_1$ . Further iterations are identical to that of the iterations of $r$ alone - as long as $M$ is large anough.