The title says it all. On my homework I am tasked with creating an algorithm that determines whether or not a natural number n can be written as the sum of two squares.
The only stipulation I am given is that I have access to (theoretically) a computer which will quickly tell me if a number k is a perfect square.
I really am just stuck on how to go about doing this, so even just a small hint in the right direction would be appreciated!