Find all decompositions of 2K² as sum of squares: possible reduction of the problem

152 Views Asked by At

I have to deal with a situation where I am trying to decompose numbers written as $2K^2, K\ge0$ into sums of squares, i.e. find: $$S_K=\{(x, y)\ |\ x^2+y^2 = 2K^2\}$$

One of the obvious solutions is $(K, K)$.

I have looked into several papers and found a number of algorithms pertaining to this. Basically the solution seems to be to decompose $K$ into its prime factors, decompose said factors as sums of two squares and apply the Brahmagupta-Fibonacci identity to obtain the decomposition, as in this answer. However, the fact that the only primes (aside from 2) that can be decomposed that way are the primes written as $4k+1$, it lead me to the following question:

Given the unique decomposition $$K = P*Q\\ P=\prod_{i=1}^{m_1}p_i^{\alpha_i}\\ Q=\prod_{j=1}^{m_2}q_j^{\beta_j}$$ Where $p_i$ and $q_j$ are all primes such as $p_i \equiv 1\ [4]$ and $q_j \equiv -1\ [4]$, and $\alpha_i, \beta_j\ge1$.

Can we assert that $S_K = \{(P^2x',P^2y')\ |\ x'^2+y'^2=2Q^2\}$ (reduced problem)? Or can this miss any decompositions?

One inclusion seems right, but I'd like to be sure that this generates all the possible solutions.

1

There are 1 best solutions below

4
On

This is completely answered in this Physics Forums discussion thread.