Seven identities that reduce hard GCD problems to one-line arguments — including the power identity, Fibonacci GCD, and Euclid's Lemma. Each with a proof short enough to reconstruct on the spot.
Most GCD problems at JEE Advanced level don't need new ideas. They need you to recognize which of a small set of identities applies, and apply it cleanly.
This page collects those identities. Each one comes with a proof short enough to reconstruct on the spot — because if you understand why it's true, you don't need to memorize it.
Identity 1 — Invariance under linear shifts
gcd(a,b)=gcd(a+kb, b)for any integer k
Proof. Common divisors of (a,b) and (a+kb,b) are identical: any d dividing both a and b also divides a+kb, and conversely d dividing a+kb and b divides (a+kb)−kb=a. ■
Special case. gcd(a,b)=gcd(a−b,b). Subtract repeatedly until the Euclidean Algorithm takes over.
JEE use. When you see gcd(f(n),g(n)) where f and g share a polynomial relationship, subtract to simplify.
Example. gcd(n2+1,n+1).
n2+1=(n+1)(n−1)+2, so gcd(n2+1,n+1)=gcd(2,n+1).
This equals 2 if n is odd, and 1 if n is even.
Identity 2 — Scaling
gcd(ma,mb)=m⋅gcd(a,b)for m>0
Proof. Write a=dp, b=dq, d=gcd(a,b), gcd(p,q)=1. Then ma=mdp, mb=mdq, and since gcd(p,q)=1, we have gcd(ma,mb)=md. ■
Consequence. Always divide out the GCD first: gcd(a/d,b/d)=1 where d=gcd(a,b). This coprime pair is the "skeleton" — everything about gcd(a,b) lives here.
Identity 3 — The power identity
gcd(an−1, am−1)=agcd(n,m)−1
This is the GCD identity that appears most often at JEE Advanced level.
Proof. The key lemma: ak−1∣an−1⟺k∣n.
Why: If n=qk, then an−1=(ak)q−1=(ak−1)((ak)q−1+⋯+1).
Now run the Euclidean algorithm on the exponents. The step gcd(an−1,am−1) with n>m:
an−1=an−m(am−1)+(an−m−1)
So gcd(an−1,am−1)=gcd(am−1,an−m−1).
The exponents reduce exactly as in gcd(n,m). The algorithm terminates at agcd(n,m)−1. ■
Example. gcd(2100−1,275−1)=2gcd(100,75)−1=225−1.
Identity 4 — Fibonacci GCD
gcd(Fn,Fm)=Fgcd(n,m)
where F1=1,F2=1,F3=2,…
Proof. The key lemma: Fm∣Fn⟺m∣n.
Then use the identity Fm+n=FmFn+1+Fm−1Fn to show:
gcd(Fm,Fn)=gcd(Fm,Fnmodm)
This is the Euclidean algorithm on Fibonacci indices. It terminates at Fgcd(m,n). ■
Example. gcd(F12,F8)=Fgcd(12,8)=F4=3.
Identity 5 — Consecutive integers are coprime
gcd(n,n+1)=1for all integers n
Proof. Any common divisor d satisfies d∣(n+1)−n=1. ■
More generally: gcd(n,n+k)=gcd(n,k).
The consecutive case is the k=1 instance — and gcd(n,1)=1 always.
Identity 6 — GCD of an arithmetic progression
If a,a+d,a+2d,… is an arithmetic progression, then:
gcd(all terms)=gcd(a,d)
Proof. Every term a+nd satisfies gcd(a+nd,d)=gcd(a,d) by Identity 1. Taking GCD over all terms gives gcd(a,d). ■
Identity 7 — LCM distributes over GCD
lcm(a,lcm(b,c))=lcm(lcm(a,b),c)(associativity)
gcd(a,lcm(b,c))=lcm(gcd(a,b),gcd(a,c))(distributivity)
These hold because both gcd and lcm operate prime-by-prime: gcd takes the minimum exponent at each prime, lcm takes the maximum. Min and max distribute over each other.
Worked problems
Problem 1. Find gcd(2100−1,275−1).
Identity 3 directly: gcd(100,75)=25. Answer: 225−1.
Problem 2. Find all n such that n+1∣n2+1.
Identity 1: n2+1=(n+1)(n−1)+2, so gcd(n2+1,n+1)=gcd(2,n+1).
For n+1∣n2+1, we need n+1∣2. So n+1∈{−2,−1,1,2}, giving n∈{−3,−2,0,1}.
Problem 3. Prove gcd(a,b)⋅gcd(a,c)=gcd(a,bc)⋅gcd(a,gcd(b,c)) when gcd(b,c)=1.
When gcd(b,c)=1, the right side becomes gcd(a,bc)⋅1. So the claim reduces to gcd(a,b)⋅gcd(a,c)=gcd(a,bc) — which follows from the prime-by-prime min/max structure.
Problem 4. Find gcd(n!+1,(n+1)!+1).
(n+1)!+1=(n+1)⋅n!+1.
gcd(n!+1,(n+1)!+1)=gcd(n!+1, (n+1)n!+1−(n+1)(n!+1))=gcd(n!+1,−n)=gcd(n!+1,n).
Since n∣n!, we have n!≡0(modn), so n!+1≡1(modn). Thus gcd(n!+1,n)=1.
Answer: gcd(n!+1,(n+1)!+1)=1 for all n≥1.
Problem 5. Prove: if gcd(a,b)=1, then gcd(a+b,a2−ab+b2)∈{1,3}.
Let d=gcd(a+b,a2−ab+b2).
Note a2−ab+b2=(a+b)2−3ab.
So d∣(a+b)2−(a2−ab+b2)=3ab.
If prime p∣d and p∣a: then p∣a+b forces p∣b, contradicting gcd(a,b)=1.
So gcd(d,a)=gcd(d,b)=1, hence d∣3.
Therefore d∈{1,3}. ■
The pattern to internalize
Every identity here follows one of two moves:
- Replace by remainder — gcd(a,b)=gcd(b,amodb), the Euclidean step.
- Use linear combinations — d∣a and d∣b implies d∣ax+by.
When a GCD problem looks hard, ask: which of these two moves simplifies it?