...
p is congruent to 3 mod 8:
3mod8 + 3mod8 + 3mod8 = 9mod8 = 1mod 8 so this is possible....
However if we look back at our original condition:
pk+pl+pm=n2 we notice that for p>3 not all three powers can be equal as this would lead to, for example:
3pk which can only be a perfect square when p=3, to make an even power on the 3 in its prime factorization. Any other value of p which is a multiple of 3 would not be both prime and square. Also we have shown above that
either all three powers are even, or two are even and one is odd. So we can say without loss of generality
k<l,m with k even.
pk(1+pl−k+pm−k)=n2