有没有办法可以显示 "imaginary" 负数或第 33 个整数之后缺少的任何数字?

Is there a way I can show the "imaginary" negative numbers or whatever numbers are missing past the 33rd integer?

# This is the original code beginning with the number 777 and I want to show the first 37 numbers.

def Collatz(n):
    i = 1
    while n != 1:
        print(f'{i}. {n}')
        if n & 1:
            n = 3 * n + 1
        else:
            n = n // 2
        i+=1

 
Collatz(777) 

我希望它过去并停在第 37 个数字。 (这可能意味着数字是虚数或负数。)

  1. 2

  2. .....

没有更多的数字可以显示。它显示的n的最后一个值为2。然后循环体执行

      n = n // 2

n 绑定到 1。然后循环结束,因为 n != 1 不再为真。

如果您仍然继续,它将继续重复 4、2、1、4、2、1、4、2、1,... 直到永远。

Collatz = 777 
i = 1
while i != 38:
    print(f'{i}. {Collatz}')
    if Collatz & 1:
            Collatz = 3 * Collatz + 1
else:
    Collatz = Collatz // 2
i+=1