How do I solve this without using congruence modulo or Fermat's theorems. This problem is from a book called challenges and thrills of pre college mathematics, since this problems is from first chapter of the book Fermat's theorem and congruence modulo isn't mentioned so I want to know if there is any other way of solving this problem. I know this problem is repeated but there wasn't a solution without Fermat's theorem or congruence modulo.
My approach was to solve for even primes and odd primes separately. I wasn't able to solve for even primes since $a^n+b^n$ is no
Hint: $$a^7+b^7= (a+b)^2[(a^5+b^5)-2ab(a^3+b^3)+3a^2b^2(a+b)]-7a^3b^3(a+b),$$ but $(a, b)=1$, so $(a+b)$ can have no prime factor in common with $a$ or $b$, so must be a multiple of 7. This generalises: (a+b)^2 is a factor of $a^{4r\pm1}+b^{4r\pm1} \mp(4r\pm1)(a+b)a^{2r}b^{2r}$.