Solution:
Since a and b are both factors of n, we can find positive integers x and y such that a=xn and b=yn. Then xn+yn=2n so
x1+y1=21.
Without loss of generality assume a⩽b. So x⩾y and x1⩽y1 and thus
y2⩾x1+y1=21.
Therefore y⩽4. So we try y=1,2,3,4 one by one.
Case 1 y=1:
This implies x1=21−y1=0 thus x=−2. This doesn't work because a (and therefore x) must be positive.
Case 2 y=2:
This implies x1=21−y1=0 which is not possible.
Case 3 y=3:
This implies x1=21−y1=61 and thus x=6. This means that n must be a multiple of 6. Now let n=6k, and we get
a=xn=66k=kandb=yn=36k=2k.
This yields the family of solutions (a,b,n)=(k,2k,6k) where k is any positive integer.
Case 4 y=4:
This implies x1=21−y1=41 and thus x=4. This means that n must be a multiple of 4. Now let n=4k, and we get
a=xn=44k=kandb=yn=44k=k.
This yields the family of solutions (a,b,n)=(k,k,4k) where k is any positive integer.
Remember that we assumed a⩽b so we still need to swap the roles of a and b for our final answer. So in summary, the triples (a,b,n) which satisfy the given equation are
(k,2k,6k), (2k,k,6k) and (k,k,4k)
where k is any positive integer.