About a natural extension of Collatz conjecture

coquelicot
Messages
303
Reaction score
70
TL;DR
A natural extension of Collatz conjecture which may be insufficiently known
The famous Collatz conjecture states that for every number n, the sequence
$$n_0 = n, \quad {\rm and}$$
$$n_{i+1} = \cases{\displaystyle{n_i \over 2}, & if $n_i$ is even,\cr
\displaystyle{3 n_i + 1\over 2}, & if $n_i$ is odd,
}$$ will eventually reach the number ##1## after a finite number of steps.

I have possibly found a natural generalization of this conjecture, which I was not able to find on the web despite hours of researching.
There is, actually, an article by Carnielli ("Some Natural Generalizations Of The Collatz Problem"), that deals with the same type of transformations, but the following conjecture does not seem to be enunciated there:

Let ##a## be a fixed natural number. For every ##n\in \mathbb N^*##, define the following sequence:
$$n_0 = n, \quad {\rm and}$$
$$n_{i+1} = \cases{\displaystyle{n_i \over a}, & if $a | n_i$,\cr
\displaystyle{(a + 1)n_i + a - r\over a}, & if $a$ does not divide $n_i$,
}$$ where ##r## is the Euclidean remainder of the division of ##n_i## by ##a##.
Then for every ##a## in a certain set S of integers, whose first values are
$$\{2, 5, 7, 8, 13, 14, 18, 19, 21, 22, 25, 26, 28, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 95, 96, 97, 98, 99\},$$
the sequence ##n_i## will eventually reach ##1## for every ##n## (and then cycle over the sequence ##1,2,3,... a-1##)

Substituting ##a = 2## in the above bring us back to the Collatz conjecture.

What is surprising is that Carnielli who has studied these transformations didn't hit at all the most striking fact, that makes this conjecture different from the other extensions found in the past: What I say here is that for many numbers n, the Collatz type transformations above will always lead to the number 1, exactly like the genuine Collatz conjecture. No cycle here! Of course, for the other numbers, Carnielli already conjectured that the sequence cycle at some stage. But the main point is that this conjecture is very, very like the original conjecture. In other words, the "3" in the ##3n + 1## has nothing particular. In fact, it turns out that "most" numbers ##a## are likely to satisfy the conjecture, as I was able to check with a program: I tested for all ##a < 1000##, ##n < 5000## and a maximal cycle length of 10000.
The numbers ##a## for which the procedure didn't ended at 1 for some n < 5000 are summarized in the following table, and there are only about 30 such numbers smaller than 1000:

a: 3 n: 5 cycle head: 7
a: 4 n: 11 cycle head: 23
a: 6 n: 7 cycle head: 23
a: 9 n: 31 cycle head: 35
a: 10 n: 34 cycle head: 42
a: 11 n: 588 cycle head: 642
a: 12 n: 767 cycle head: 1348
a: 15 n: 49 cycle head: 53
a: 16 n: 35 cycle head: 178
a: 17 n: 19 cycle head: 79
a: 20 n: 63 cycle head: 71
a: 23 n: 49 cycle head: 82
a: 24 n: 201 cycle head: 335
a: 25 n: 2341 cycle head: 4064
a: 27 n: 196 cycle head: 545
a: 29 n: 91 cycle head: 111
a: 31 n: 352 cycle head: 389
a: 48 n: 49 cycle head: 136
a: 54 n: 825 cycle head: 3406
a: 57 n: 2089 cycle head: 3416
a: 78 n: 712 cycle head: 1494
a: 85 n: 1979 cycle head: 4435
a: 94 n: 475 cycle head: 1308
a: 111 n: 1792 cycle head: 2838
a: 123 n: 125 cycle head: 195
a: 134 n: 1351 cycle head: 1871
a: 136 n: 822 cycle head: 1356
a: 172 n: 693 cycle head: 887
a: 225 n: 3390 cycle head: 4773
a: 368 n: 1476 cycle head: 3805
a: 419 n: 3361 cycle head: 5785
a: 540 n: 1623 cycle head: 3292

Here is a the Python code that may help to figure out the above conjecture:
Mentor note: Code tags added to retain original indentation.
Python:
cycle_length_threshold = 10000

check_for_n_up_to = 1000


def procedure_1(n, p,
                cycle_length_threshold,
                verbose=False,
                check_cycle=False):
    count = 0
    cycle_buffer = set()
    while count < cycle_length_threshold:
        old_n = n
        rem = n % p
        if rem == 0:
            if verbose:
                print(n, 'divisible by p')
            cycle_buffer.add(n)
            n = n//p
            if n == 1:
                if verbose:
                    print(n)
                return 0
        else:
            if verbose:
                print(n, 'performing transformation:')
            if n in cycle_buffer:
                if verbose:
                    print('cycle found. Cycle head: ', n)
                return n
            else:
                cycle_buffer.add(n)
             
            n = (n * (p+1) + p - rem) // p
            if n == old_n:  # stable state has been reached
                if verbose:
                    print('stable state has been reached: ', n)
                return n
            elif n == 1:
                if verbose:
                    print(n)
                return 0
        count += 1
    if verbose:
        print('Maximal cycle length has been reached - aborting.') 
    return -1

integer_list = []

for p in range (2, 1000):
    flag = True
    for n in range(1, 5000):
        ret = procedure_1(n, p, cycle_length_threshold)
        print(ret, end="")     
        if ret != 0:
            flag = False
            if ret != -1:
                print('a: ', f"{p:<7}", '\tn: ', f"{n:<7}", '\tcycle head: ', ret)
            else:
                print('a: ', f"{p:<7}", '\tn: ', f"{n:<7}", '\t(max cycle length reached)')             
            break
    if flag:
        integer_list.append(p)
    
print('Integer list: ', integer_list)
 
Last edited by a moderator:

Similar threads

  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 30 ·
2
Replies
30
Views
5K
  • · Replies 7 ·
Replies
7
Views
8K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 42 ·
2
Replies
42
Views
13K
  • · Replies 10 ·
Replies
10
Views
7K
  • · Replies 1 ·
Replies
1
Views
5K