https://www.baeldung.com/java-check-sum-two-squares-efficiently
Efficiently Check for a Sum of Two Squares in Java | Baeldung
Nov 17, 2025 - Learn how to use Fermat's theorem to efficiently check if a number is the sum of two squared integers.
sum of two squaresefficientlycheck