5

Which rational number $\dfrac pq$ can be written in the form $\left(\dfrac a b \right)^2 + \left( \dfrac c d \right)^2 + \left( \dfrac e f \right)^2$ where $a,c,e,p$ are nonnegative integers and $b,d,f,q$ are natural numbers?

It is known that a natural number can be written as sum of 3 squares iff it is not of the form $4^{a-1}(8b-1)$, where $a$ and $b$ is a natural number, due to a result of Legendre. Here by "squares" I mean they can be integers or non-integral rational. But I do not know how I can generalize these results to all rational numbers.

For the case of 2 squares it is much simpler. For a rational number $\dfrac pq$, if $p$ and $q$ are coprime, then it is a sum of 2 squares iff $p$ and $q$ can be written in terms of 2 squares, i.e. their prime decompositions do not contain a factor of the form $(4a-1)^{2b-1}$, where $a, b$ are natural numbers. But such result does not easily generalize to 3 squares.

wilsonw
  • 1,046
  • There is another option. If you imagine. $$\frac{a^2}{b^2}+\frac{c^2}{d^2}+\frac{e^2}{f^2}=\frac{p}{q}$$ How is this equation: $$qa^2+qc^2+qe^2=py^2$$ Then you can use this formula. http://math.stackexchange.com/questions/1127654/parametrization-of-solutions-of-diophantine-equation – individ Mar 22 '15 at 18:19
  • Can you give a reference or proof for the case of two squares mentioned in the last paragraph? See http://math.stackexchange.com/q/1445058/589. – lhf Sep 21 '15 at 14:11

1 Answers1

6

Your question is equivalent to $qp(bdf)^2$ is sum of three squares which is equivalent to not being of the form $4^a(8b-1)$ and because $(bdf)^2$ is of the form $4^x(8y+1)$ you can easily conclude that $pq$ is not of the form $4^a(8b-1)$, the converse is also true, so as an answer:

A rational number $\frac{p}{q}$ is sum of three rational squares if and only if $pq$ is not of the form $4^a(8b-1)$

Elaqqad
  • 13,983
  • yes we can if we say that $p$ is of the form $4^a(8b+x)$ and $q$ is of the form $4^{a'}(8b'+y)$ suct that $xy\neq-1 \mod 8$ but it's not elegant and I suspect that there is no a better way! – Elaqqad Mar 22 '15 at 11:41
  • 1
    I think you mean $qp(bdf)^2$ is NOT of the form $4^a(8b-1)$... that's what the theorem says. – wilsonw Mar 22 '15 at 11:43
  • 1
    I was really lost but I corrected it – Elaqqad Mar 22 '15 at 11:45
  • I am sorry I still don't get it... so $qp(bdf)^2$ is not the form $4^a(8b-1)$, but how do you deduce that $(bdf)^2$ is of the form $4^x(8y+1)$ or not? – wilsonw Mar 22 '15 at 11:47
  • 1
    It's not a deduction, The square of every integer is of the form $4^y(8x+1)$,by the following proof if $n=2^q(2p+1)$ then : $$n^2=4^q(8\frac{p^2+p}{2}+1) $$ – Elaqqad Mar 22 '15 at 11:50
  • Oh! I get it now... and btw $xy \neq -1 \mod 8$ is equivalent to $x \neq -y \mod 8$ because $p$ and $q$ are coprime and therefore not both even, and the only $(x,y)$ satisfying $xy\equiv -1 \mod 8$ are (1,7),(3,5), (5,3) and (7,1) I think? – wilsonw Mar 22 '15 at 12:03
  • 1
    Yes you can reduce it to some finite cases – Elaqqad Mar 22 '15 at 12:05