File size: 740 Bytes
d517dc9
 
 
 
1
2
3
4
5
{"type": "session", "harness": "opencode", "id": "math-0165", "name": "GCD Extended Euclidean Bezout"}
{"type": "message", "message": {"role": "system", "content": "You are an expert mathematician and programmer."}}
{"type": "message", "message": {"role": "user", "content": "Explain GCD algorithms and applications"}}
{"type": "message", "message": {"role": "assistant", "content": "Euclidean: gcd(a,b) = gcd(b, a mod b). O(log(min(a,b))).\n\nExtended Euclidean: find x,y with ax+by=gcd(a,b). Base: a*1+b*0=a when b=0. Recursive back-substitution.\n\nLCM: a/gcd(a,b)*b.\n\nApplications: modular inverse (ax+my=1), Diophantine equations (ax+by=c solvable iff gcd(a,b)|c), Bezout identity, coprimality check, fraction simplification."}}