lunes, 17 de marzo de 2025

Collatz Conjecture (The number of bits of the biggest number in a path is less than the number of bits of the initial number * 3 + 1)

I have a Conjecture for the 3x+1 problem:

The number of bits of the biggest number (in binary notation) in a path is less than the number of bits of the initial number (in binary notation) * 3 + 1

Unfortunately, I do not know if this can help with a proof, or even how to proof the conjecture.

But I've tested it from 3 to  7_129_136_416_377_336_271_197 successfully with the following python program.

def three_x_plus_one(x):
    if x & 1 == 0:  # % 2 == 0:
        return x >> 1  # //2
    return ((x << 1) | 1) + x  # x*3+1


def max_in_path(initial):
    m = initial
    x = initial
    while x != 1:
        x = three_x_plus_one(x)
        if x > m:
            m = x
    return m


def main():
    # 27 is 11011 (5 bits), its maxumim is 9232 or 10010000010000 (14 bits), 5*3+1=16 bits
    for i in range(3 7129136416377336271197, 2):

        m = max_in_path(i)
        m1 = i.bit_length()
        m2 = m.bit_length()

        # Conjecture:
        # The number of bits of the biggest number in a path is less than the number of bits of the initial number * 3 + 1
        m1_3 = ((m1 << 1) | 1) + m1
        if m2 >= m1_3:
            print("Doesn't apply for i", i, "m1", m1, "m1*2", m1_3, "m2", m2, "m2-m1 * 2", m2 - (m1_3)) 


main()

 

Copyleft Ender. El presente artículo no tiene finalidad informativa, de creación de opinión pública o de entretenimiento. Tiene como finalidad principal, la enseñanza y la divulgación de experiencias, proyectos, pensamientos y conocimientos del autor. Se permite la copia textual, la traducción y la distribución de este artículo entero en cualquier medio, a condición de que este aviso sea conservado. Se permite la cita. El autor no reclamará ninguna cantidad por el ejercicio de las dos autorizaciones anteriores. No autorizo a ninguna Entidad de Derechos de Autor a reclamar cantidad alguna en mi nombre por el ejercicio de los dos derechos anteriores. 

No hay comentarios:

Publicar un comentario