MathLabs

Problem 3

Find all positive integers nn that can be written as n=a2+b2n=a^2+b^2, where a,ba,b are relatively prime positive integers and every prime p<=sqrt(n)p <= sqrt(n) divides abab.
Step 2 of 4: Force consecutive summands
a−b>1;p∣(a−b);p<=a−b<sqrt(a2+b2)=sqrt(n)a-b>1; p | (a-b); p <= a-b < sqrt(a^2+b^2)=sqrt(n)
Detailed analysis

Suppose a>ba>b and a−b>1a-b>1. Choose a prime divisor pp of a−ba-b. Since p<=a−b<sqrt(a2+b2)=sqrt(n)p<=a-b<sqrt(a^2+b^2)=sqrt(n), the hypothesis gives p∣abp | ab. Thus pp divides aa or bb; together with p∣(a−b)p | (a-b) this makes pp divide both, contradicting gcd(a,b)=1gcd(a,b)=1. Hence a−b=1a-b=1.