This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import gcd #for gcd function (or easily implementable to avoid import) | |
import random #for random elements drawing in RecoverPrimeFactors | |
def failFunction(): | |
print("Prime factors not found") | |
def outputPrimes(a, n): | |
p = gcd(a, n) | |
q = int(n // p) | |
if p > q: |