x = zufällige Zahl zwischen 0 und n – 1 y = x while True: x = x2k + 1 y = y2k + 1 y = y2k + 1 g = gcd(n, y – x) if g ≠ 1 && g ≠ n: return g