Under what conditions for k such that the circle equation $x^2 + y^2 = k$ has rational solutions for both $x$ and $y$?
For example, when $k = 4$, $\{x=2, y=0\}$ is a set of rational solutions. But when $k=3$, it seems like there is none.
Obviously when $k$ is a square number, we can always find a set of rational solutions. However, how can we derive it?
P.S. I've encountered the problem while coming across congruence and number theory.
The sequence (A001481) of $k$ such that $x^2+y^2 = k$ or $(x/z)^2+(y/z)^2 = k$ has a solution in integer $x,y,z$ is the same, namely,
$$k=0, 1, 2, 4, 5, 8, 9, 10, 13, 16, 17, 18, 20, 25, 26, 29, 32, 34, 36, 37,\dots$$
The necessary condition is given by Fermat's theorem on sums of two squares. While stated for prime $k$, if used together with the Brahmagupta–Fibonacci identity, then it covers composite $k$ as well.