Maths WorkshopMaths problems with full solutions
Exercise 1646Number theory › Divisibility and gcdOlympiadAdded 3 Nov 2026

Coprime numbers and exponents

#coprime#exponents#gcd

Statement

Let a,ba,b be coprime positive integers. Show that if am=bna^m=b^n for some m,n≥1m,n\ge1, then aa and bb are perfect powers (i.e. a=cka=c^k for some integer cc and k≥1k\ge1).

Hint

Compare prime factorizations of aa and bb.

Show solutionHide solution

Solution

Prime factorization. a=∏pupa=\prod p^{u_p}, b=∏pvpb=\prod p^{v_p}. Since gcd⁡(a,b)=1\gcd(a,b)=1, for each prime pp at most one of up,vpu_p,v_p is positive.

Equality. am=bna^m=b^n means mup=nvpmu_p=nv_p for all pp.

Conclusion. If up>0u_p>0, then vp=0v_p=0 and mup=0mu_p=0, contradiction. So up=0u_p=0 for all pp, i.e. a=1a=1. Similarly b=1b=1.

Correction: The statement as written is trivial if interpreted literally. The correct nontrivial statement is: am=bna^m=b^n implies both are powers of a common integer. Indeed, with d=gcd⁡(m,n)d=\gcd(m,n) and m=dm′m=d m', n=dn′n=d n', we have am′=bn′a^{m'}=b^{n'}, and since gcd⁡(m′,n′)=1\gcd(m',n')=1 we get a=cn′a=c^{n'}, b=cm′b=c^{m'} for some integer cc.

Conclusion. aa and bb are both powers of a common integer.