How to Multiply with the 3n + 1 series (Collatz Conjecture)

August 6, 2022
Time to read: 1 min

Introduction

I stumbled across an interesting paper, which shows that you can multiply two numbers by using the Collatz conjecture (and assuming it to be true for the numbers you are dealing with).

This post contains my summary and understanding of how this method works.

Background

Collatz conjecture

Definition

The Collatz conjecture, also known as the 3n + 1 problem, is a simple to describe, yet unsolved, problem in discrete mathematics. The conjecture states that if you start with a positive integer n and apply the following rule to it:

The number will eventually land in the cycle 4 \rightarrow 2 \rightarrow 1 \rightarrow 4. The conjecture states: this the only cycle. There is no proof to confirm this, however, we have tested up to a very large number and the conjecture seems to hold. Thus, for all practical purposes: the conjecture is true.

The rule can be mathematically written as:

f(n) = \begin{cases} \frac{n}{2} &\text{if } n \equiv 0 \text{ (mod 2)} \\ 3n + 1 &\text{otherwise} \end{cases}

Examples

10

18

Method

Definitions

Collatz Function

Define the Collatz function, F, as the Collatz conjecture with path of dividing by 2 compressed into one step, that is:

Given x, a positive odd integer:

F(x) = \frac{3x + 1}{2^{\text{ctz}(3x + 1)}}

Collatz sequence and k

In other words, the Collatz sequence can be shown mathematically like so: x, F_1(x), F_2(x), ..., F_{k-1}(x), 1

How to Divide: \frac{m}{a}

Let's multiply the Collatz function series by a, we get:

ax, aF_1(x), aF_2(x), ..., aF_{k-1}(x), a

Let m = ax, we get

\begin{aligned} a F(x) & = a \frac{3x + 1}{2^{\text{ctz}{(a(3x + 1))}}} \\ & = \frac{3ax + a}{2^{\text{ctz}{(3ax + a)}}} \\ & = \frac{3m + a}{2^{\text{ctz}{(3m + a)}}} \\ & = G(m) \end{aligned}

NOTES: ctz(3m+a) = ctz(3m+1) when a is odd

Assuming a \mid m (a divides m), we can:

  1. Start with m
  2. Use G(m) until we get to a
    • Record what we've done to get there
    • i.e. save the result of \text{ctz}(3x + 1) along the way and k (the number of steps)
  3. Backtrack using the same form of operations (in reverse) with F(x) whilst starting at 1

i.e. we have a division algorithm using the Collatz conjecture

How to Multiply: ax

Now, how do we multiply? Simple: