"3n + 1 problem" variant, using (n/2 + 3)

175 Views Asked by At

Background

Variant "3n + 1 problem"

Consider a mapping similar to the original "3n + 1 problem" (Collatz conjecture):

  • $n → n/2 + 3$ for even n (variant rule due to +3)
  • $n → 3n + 1$ for odd n

Python Code

from collections import deque

def hailstone_cycle(n):
    sequence = []
    while n not in sequence:
        sequence.append(n)
        n = 3*n + 1 if n & 1 else n//2 + 3
    cycle_start_index = sequence.index(n)
    cycle = deque(sequence[cycle_start_index:])
    index_of_min = cycle.index(min(cycle))
    cycle.rotate(-index_of_min)
    return {cycle[0]: list(cycle)}

print(hailstone_cycle(27))

Where the code has extra complexity to deal with different types of cycles.

Cycles

The standard "3n + 1 problem" has 4 known non-trivial cycles:

  • A trivial cycle at $0$
  • A 3-cycle including $+1$
  • A 2-cycle including $-2$
  • A 5-cycle including $-20$
  • A 18-cycle including $−272$

This variant "3n + 1 problem" has 13 known non-trivial cycles

  • A trivial cycle at $+6$
  • A 39-cycle including $+137$
  • Seven 13-cycles including $+217,+233,+257,+265,+289,+293,+325$
  • A 3-cycle including $+19$
  • Two 5-cycles including $+7,-254$
  • A 2-cycle including $-20$
  • A 18-cycle including $-3530$

Observations

Up until this point, nothing would have stood out as particularly unusual to me, except perhaps the seven 13-cycles. But I noticed a connection to another question that relates to Heegner numbers and the Ulam spiral. While these are qualitative observations, I think many would find them unusual:

  • $(n^2+n−4^2)/2$ for $1≤n≤6$ produces $−7,−5,−2,2,7,13$, which resembles the "Seven 13-cycles" and "Two 5-cycles" above.
  • The sum of the lengths of the non-trivial cycles adds to $2+3+5*2+13*7+18+39=163$ (the largest Heegner number).
  • The lengths and frequencies of the cycles uses only $2,3,5,7,13$ as prime factors (all divisors of 12, plus 1).

An interesting property of this mapping is that values congruent to 6 mod 13 are stable:

  • $(13*h+6)/2+3=13*(h/2)+6$
  • $(13*t+6)*3+1=(13*3)t+19=13*(3t+1)+6$

This led me to the following observation in the original "3n + 1 problem"

  • $(13*r+6)/2=13*(r/2)+3=13*(r/2+3)-36$

This led me to wonder if there's a mathematical subject that deals with nested/recursive subspaces that could try to combine the original and variant "3n + 1 problem" to simultaneously use both equations:

  • $(13*h+6)/2+3=13*(h/2)+6$
  • $(13*r+6)/2=13*(r/2+3)-36$

Question

  1. What concepts in number theory can be used to represent infinitely nested subspaces? (The phrase "Turtles all the way down" comes to mind.)
  2. Are there any concepts that can combine two similar classes of transformation/mapping problems into one?
1

There are 1 best solutions below

0
On BEST ANSWER
  1. My early thought for nested subspaces was to use concepts similar to finite fields, although I think this would require some research and development.
  2. I found a simple and elegant solution to how to combine the transformations, just consider the problem mod 4.

My Python code looks like:

def hailstone(n):
    sequence = []
    while n not in sequence:
        sequence.append(n)
        residue = n % 4
        if residue in [1,3]:
            n = 3*n + 1
        elif residue == 2:
            n = n//2 + 3
        else: #residue == 0
            n = n//2 + 0
    return {sequence[0]: sequence}

Notably, this variant has 3 types of cycles:

  • 0 → 0 → 0 | n congruent to 0 mod 6 and $n ≤ 0$
  • 6 → 6 → 6 | n congruent to 0 mod 6 and $n ≥ 6$
  • 4 → 2 → 4 | otherwise

Is it useful? I'm not sure yet.