Academy
MathsNumber TheoryGcd LcmGCD and LCM — Problem Set

GCD and LCM — Problem Set

14 graded problems from direct computation to olympiad-adjacent. Each solution names the exact tool it uses, with a quick-reference table at the end.

Each problem below names the tool it uses. If a problem is hard, go back to that page first.


Level 1 — Direct

P1. Find gcd(21001,2751)\gcd(2^{100}-1, 2^{75}-1).

Tool: Power Identity

gcd(21001,2751)=2gcd(100,75)1=2251\gcd(2^{100}-1, 2^{75}-1) = 2^{\gcd(100,75)}-1 = 2^{25}-1.


P2. If gcd(a,b)=12\gcd(a,b) = 12 and lcm(a,b)=1800\text{lcm}(a,b) = 1800, find all pairs (a,b)(a,b) with aba \leq b.

Tool: Fundamental Relation

Write a=12pa = 12p, b=12qb = 12q with gcd(p,q)=1\gcd(p,q)=1 and pq=1800/12=150=2×3×52pq = 1800/12 = 150 = 2 \times 3 \times 5^2.

Coprime factor pairs of 150 with pqp \leq q:

(p,q)(p,q)gcd\gcd?Valid?
(1,150)(1, 150)1
(2,75)(2, 75)1
(3,50)(3, 50)1
(6,25)(6, 25)1
(10,15)(10, 15)5

Pairs (a,b)(a,b): (12,1800)(12, 1800), (24,900)(24, 900), (36,600)(36, 600), (72,300)(72, 300).


P3. How many integers in {1,,1000}\{1, \ldots, 1000\} are coprime to 1000?

Tool: Euler's Totient

ϕ(1000)=1000×(112)(115)=400\phi(1000) = 1000 \times (1-\tfrac{1}{2})(1-\tfrac{1}{5}) = 400.


P4. Find gcd(F18,F12)\gcd(F_{18}, F_{12}) where FnF_n is the nn-th Fibonacci number.

Tool: Fibonacci GCD

gcd(F18,F12)=Fgcd(18,12)=F6=8\gcd(F_{18}, F_{12}) = F_{\gcd(18,12)} = F_6 = 8.


Level 2 — JEE Pattern

P5. Find all integers nn such that n+1n2+1n+1 \mid n^2+1.

Tool: Invariance under shifts

n2+1=(n+1)(n1)+2n^2+1 = (n+1)(n-1)+2, so n+1n2+1    n+12n+1 \mid n^2+1 \iff n+1 \mid 2.

Thus n+1{2,1,1,2}n+1 \in \{-2,-1,1,2\}, giving n{3,2,0,1}\boxed{n \in \{-3,-2,0,1\}}.


P6. Find all positive integer solutions to 12x+8y=10012x + 8y = 100.

Tool: Linear Diophantine Equations

d=gcd(12,8)=4d = \gcd(12,8) = 4 and 41004 \mid 100. ✓ Divide: 3x+2y=253x + 2y = 25.

Particular: (x0,y0)=(1,11)(x_0, y_0) = (1, 11). General: x=1+2kx = 1+2k, y=113ky = 11-3k.

Positive constraints: k0k \geq 0 and k3k \leq 3.

4 solutions: (1,11),(3,8),(5,5),(7,2)(1,11), (3,8), (5,5), (7,2).


P7. Prove: gcd(n2+1,n+1){1,2}\gcd(n^2+1, n+1) \in \{1, 2\} for all integers nn.

Tool: Invariance

gcd(n2+1,n+1)=gcd(2,n+1)\gcd(n^2+1, n+1) = \gcd(2, n+1), which is 2 if nn is odd, 1 if nn is even. \blacksquare


P8. Find the number of ordered pairs (a,b)(a,b) of positive integers such that lcm(a,b)=23×32×5\text{lcm}(a,b) = 2^3 \times 3^2 \times 5.

Tool: Prime-by-prime LCM counting

For lcm(a,b)=p1e1pkek\text{lcm}(a,b) = p_1^{e_1} \cdots p_k^{e_k}, the count of ordered pairs is (2ei+1)\prod (2e_i + 1).

(2×3+1)(2×2+1)(2×1+1)=7×5×3=105(2\times3+1)(2\times2+1)(2\times1+1) = 7 \times 5 \times 3 = 105.


P9. Find gcd(n!+1,(n+1)!+1)\gcd(n!+1, (n+1)!+1) for all n1n \geq 1.

Tool: Reduction to remainder

(n+1)!+1=(n+1)n!+1(n+1)!+1 = (n+1)\cdot 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+1)!+1) = \gcd(n!+1, (n+1)\cdot n!+1 - (n+1)(n!+1)) = \gcd(n!+1, -n).

Since nn!n \mid n!, we have n!+11(modn)n!+1 \equiv 1 \pmod n, so gcd(n!+1,n)=1\gcd(n!+1, n) = 1.

Answer: always 1.


P10. Solve the system: x3(mod4)x \equiv 3 \pmod 4, x5(mod6)x \equiv 5 \pmod 6, x2(mod7)x \equiv 2 \pmod 7.

Tool: Chinese Remainder Theorem

Note: gcd(4,6)=21\gcd(4,6) = 2 \neq 1, so CRT doesn't directly apply. Check compatibility:

x3(mod4)    xx \equiv 3 \pmod 4 \implies x is odd. x5(mod6)    xx \equiv 5 \pmod 6 \implies x is odd (since 55 is odd). ✓

Combine first two: x3(mod4)x \equiv 3 \pmod 4 and x5(mod6)x \equiv 5 \pmod 6.

x=4j+3x = 4j+3. Then 4j+35(mod6)    4j2(mod6)    2j1(mod3)    j2(mod3)4j+3 \equiv 5 \pmod 6 \implies 4j \equiv 2 \pmod 6 \implies 2j \equiv 1 \pmod 3 \implies j \equiv 2 \pmod 3.

So j=3m+2j = 3m+2, x=4(3m+2)+3=12m+11x = 4(3m+2)+3 = 12m+11. Thus x11(mod12)x \equiv 11 \pmod{12}.

Now combine x11(mod12)x \equiv 11 \pmod{12} and x2(mod7)x \equiv 2 \pmod 7. Here gcd(12,7)=1\gcd(12,7)=1. ✓

x=12n+11x = 12n+11. Then 12n+112(mod7)    5n95(mod7)    n1(mod7)12n+11 \equiv 2 \pmod 7 \implies 5n \equiv -9 \equiv 5 \pmod 7 \implies n \equiv 1 \pmod 7.

n=7t+1n = 7t+1, x=12(7t+1)+11=84t+23x = 12(7t+1)+11 = 84t+23.

Answer: x23(mod84)x \equiv 23 \pmod{84}.


Level 3 — Advanced

P11. Prove: if gcd(a,b)=1\gcd(a,b)=1, then gcd(a+b,a2ab+b2){1,3}\gcd(a+b, a^2-ab+b^2) \in \{1,3\}.

Tool: Bezout + Euclid's Lemma

Let d=gcd(a+b,a2ab+b2)d = \gcd(a+b, a^2-ab+b^2).

Since a2ab+b2=(a+b)23aba^2-ab+b^2 = (a+b)^2 - 3ab, we get d3abd \mid 3ab.

If prime pdp \mid d and pap \mid a: then pa+bp \mid a+b forces pbp \mid b, contradicting gcd(a,b)=1\gcd(a,b)=1.

So gcd(d,a)=gcd(d,b)=1\gcd(d,a) = \gcd(d,b) = 1, hence d3d \mid 3.

d{1,3}d \in \{1, 3\}. \blacksquare

Both values are achieved: a=1,b=1a=1, b=1 gives d=1d=1; a=1,b=2a=1, b=2 gives gcd(3,3)=3\gcd(3,3)=3.


P12. Find all positive integer solutions to 1x+1y=1n\dfrac{1}{x} + \dfrac{1}{y} = \dfrac{1}{n} for fixed positive integer nn.

Tool: Diophantine + divisor counting

Rearranging: ny+nx=xy    xynxny=0    (xn)(yn)=n2ny + nx = xy \implies xy - nx - ny = 0 \implies (x-n)(y-n) = n^2.

Each factorization n2=d1d2n^2 = d_1 d_2 with d1,d2>0d_1, d_2 > 0 gives a solution: x=n+d1x = n + d_1, y=n+d2y = n + d_2.

Number of ordered solutions = τ(n2)\tau(n^2), the number of positive divisors of n2n^2.

Example. n=6n = 6: n2=36n^2 = 36 has τ(36)=9\tau(36) = 9 divisors. 9 ordered pairs (x,y)(x,y).


P13. Prove: lcm(1,2,,2n)4n2n+1\text{lcm}(1, 2, \ldots, 2n) \geq \dfrac{4^n}{2n+1}.

Tool: LCM and combinatorics

The central binomial coefficient (2nn)\binom{2n}{n} is an integer. Its denominator in lowest terms divides lcm(1,2,,2n)\text{lcm}(1, 2, \ldots, 2n) — in fact, lcm(1,,2n)/(2nn)\text{lcm}(1,\ldots,2n) / \binom{2n}{n} is an integer.

Wait — more directly: since (2nn)\binom{2n}{n} is an integer, and (2nn)=(2n)!(n!)2\binom{2n}{n} = \frac{(2n)!}{(n!)^2}, the value lcm(1,,2n)1n!2\text{lcm}(1,\ldots,2n) \cdot \frac{1}{n!^2} is... let me state the cleaner path.

From (1+1)2n=k=02n(2nk)(1+1)^{2n} = \sum_{k=0}^{2n}\binom{2n}{k} and all terms are positive: (2nn)4n\binom{2n}{n} \leq 4^n.

Also the sum has 2n+12n+1 terms all at most (2nn)\binom{2n}{n}, so 4n(2n+1)(2nn)4^n \leq (2n+1)\binom{2n}{n}, giving (2nn)4n2n+1\binom{2n}{n} \geq \frac{4^n}{2n+1}.

Now observe: lcm(1,2,,2n)\text{lcm}(1,2,\ldots,2n) is divisible by (2nn)\binom{2n}{n} (each (2nk)\binom{2n}{k} is an integer; the LCM of denominators... actually use: (2nn)something=lcm(1,,2n)lcm(1,,n)2(2n)!/(2n)!\binom{2n}{n} \cdot \text{something} = \frac{\text{lcm}(1,\ldots,2n) \cdot \text{lcm}(1,\ldots,n)^2}{(2n)!/(2n)! }...

The cleanest path: (2nn)lcm(1,,2n)\binom{2n}{n} \mid \text{lcm}(1,\ldots,2n) because lcm(1,,2n)/(2nn)=lcm(1,,2n)(n!)2(2n)!\text{lcm}(1,\ldots,2n) / \binom{2n}{n} = \frac{\text{lcm}(1,\ldots,2n) \cdot (n!)^2}{(2n)!} is the product over primes of certain prime power ratios that are always integers.

Therefore lcm(1,,2n)(2nn)4n2n+1\text{lcm}(1,\ldots,2n) \geq \binom{2n}{n} \geq \dfrac{4^n}{2n+1}. \blacksquare


P14. (Construction) Show that for any integer n2n \geq 2, there exist nn consecutive integers each having a prime factor not dividing any of the others.

This uses the Chinese Remainder Theorem to construct a starting point, combined with the Fundamental Theorem of Arithmetic. The proof is existential — CRT guarantees the starting integer exists.

Left as an exercise — reconstruct the CRT-based construction using the CRT page.


Quick reference

GoalTool
Compute gcd\gcdEuclidean Algorithm
Write gcd\gcd as a combinationBezout / Extended Euclidean
Prove dgcd(a,b)d \mid \gcd(a,b)Bezout: gcd=ax+by\gcd = ax+by
Show aca \mid c given abca\mid bc, gcd(a,b)=1\gcd(a,b)=1Euclid's Lemma
Solve ax+by=cax+by=cBezout + general solution
Solve axb(modm)ax \equiv b \pmod mReduce by dd, then invert
gcd(an1,am1)\gcd(a^n-1, a^m-1)Power Identity
gcd(Fn,Fm)\gcd(F_n, F_m)Fibonacci GCD Identity
Count coprime integersEuler's Totient
Simplify gcd(f(n),g(n))\gcd(f(n), g(n))Replace by remainder (shift identity)
Count pairs with given LCM(2ei+1)\prod(2e_i+1) over prime factorization
Simultaneous congruencesCRT (requires pairwise coprimality)