Skip to content

Instantly share code, notes, and snippets.

View Hong5489's full-sized avatar
🎯
Focusing

Stephen Hong5489

🎯
Focusing
View GitHub Profile
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: