7

It is well known that every positive integer is the sum of at most four perfect squares (including $1$).

But which positive integers are not the sum of four non-zero perfect squares ($1$ is still allowed as a perfect square) ?

I showed that the numbers $2^k$ , $2^k\cdot 3$ and $2^k\cdot 7$ with odd positive integer $k$ have this property. I checked the numbers upto $10^4$ and above $41$, no examples , other than those of the mentioned forms , occured. So my question is whether additional positive integers with the desired property exist.

Peter
  • 84,454
  • Another formulation of the question : If $n>41$ is an integer and $n=a^2+b^2+c^2+d^2$ has no solution in positive integers, must $n$ be of the form $2^k$ or $2^k\cdot 3$ or $2^k\cdot 7$ with odd positive integer $k$ ? – Peter Jun 09 '18 at 13:51
  • Worth mentioning is OEIS sequence A000534 "Numbers that are not the sum of 4 nonzero squares." – Somos Apr 02 '20 at 21:03

2 Answers2

6

page 140 in Conway's little book, $$ 1,3,5,9,11,17,29,41, \; 2 \cdot 4^m \; , \; 6 \cdot 4^m \; , \; 14 \cdot 4^m \; . $$ The proof is on the same page, with preparatory material in the previous few pages.

The first detail: any number $3 \pmod 8$ is the sum of three squares, meanwhile they must be odd squares, therefore nonzero. The square of any number that is divisible by $4$ becomes $0 \pmod 8.$ As a result, any number $6 \pmod 8$ is the sum of three squares, as $ (2A)^2 + B^2 + C^2,$ where $A,B,C$ must be odd squares, therefore nonzero.

10 June: Second detail: if $x^2 + y^2 + z^2 \equiv 0 \pmod 4,$ then $x,y,z$ are all even. This means that $12 \pmod{32}$ is the sum of three nonzero squares. Same for $24 \pmod{32}$

Will Jagy
  • 139,541
  • @JamesArathoon I transcribed incorrectly. I put in a link for a pdf, you can check page 140 yourself. Believe I have it now. – Will Jagy Jun 09 '18 at 18:17
  • Thanks for correcting transcription. All the primes listed are the sum of 2 or 3 non-zero squares. In the case of the largest 3 primes above, 17, 29, and 41 they are the sum of both 2 and 3 non-zero squares. The proof shows that any prime larger than 41 must be the sum of 4 non-zero squares, even if that prime is the sum of both 2 and 3 non-zero squares. – James Arathoon Jun 09 '18 at 18:34
  • Thank you. So every other number can be expressed as the sum of four non-zero squares. – Peter Jun 09 '18 at 20:07
  • @Peter yes. I put a link to a pdf of Conway's book. You would like the first chapter, he defines the Topograph method, which becomes especially useful when trying to find all solutions $(x,y)$ to $A x^2 + B xy + C y^2 = N.$ Recently you were asking about finding all solutions to $x^2 - k y^2 = n,$ the topograph is the responsible way to do that. – Will Jagy Jun 09 '18 at 20:14
  • @WillJagy Sorry, I looked at page $140$ , but I didn't find where the key for the proof is. Please help! – Peter Jun 09 '18 at 20:38
  • @Peter I added a little. – Will Jagy Jun 09 '18 at 21:27
  • @WillJagy With your additional argument, I could solve all cases except the cases $n=8k+1$ and $n=8k+5$ – Peter Jun 10 '18 at 05:21
  • @WillJagy Thank you, that helped me to finish the proof. I admit that I have great difficulties to follow the paper. As I understood, there is a method to systematically construct all possible values of an indefinite quadratic form. But I did not understand the iteration that does it. – Peter Jun 11 '18 at 21:26
  • @Peter the topograph is something you learn by doing. Here is another book that does it. I also know two books (that one must buy or borrow) that teach how to do it. Also, I have posted many, many topographs on this site, with a fairly standardized method for drawing that is good for drawing by hand. Book: http://pi.math.cornell.edu/~hatcher/TN/TNpage.html – Will Jagy Jun 11 '18 at 22:28
  • @WillJagy So, the "climbing-down-step" is just a multiplication of some vector with the inverse matrix derived from the fundamental solution of the pell-equation ? If so, I wonder why this is not explicitely mentioned. Especially confusing is that the paper introduces vectors, bases , superbases, and so on, but the example given is poorly described (at least in my opinion). It was very hard for me to follow how the values are determined. Anyway, thanks for the additional answer. – Peter Jun 12 '18 at 11:54
4

Some of my topograph answers, in order by question number. I got better with the diagrams as time went by. If you just look at these, not much will happen. If you draw some of your own examples, you will begin to understand.

================

BOOKS:

http://www.maths.ed.ac.uk/~aar/papers/conwaysens.pdf (Conway)

http://www.springer.com/us/book/9780387955872 (Stillwell)

https://www.math.cornell.edu/~hatcher/TN/TNbook.pdf (Hatcher)

http://bookstore.ams.org/mbk-105/ (Weissman)

==============

ANSWERS:

http://math.stackexchange.com/questions/81917/another-quadratic-diophantine-equation-how-do-i-proceed/144794#144794

http://math.stackexchange.com/questions/228356/how-to-find-solutions-of-x2-3y2-2/228405#228405

http://math.stackexchange.com/questions/342284/generate-solutions-of-quadratic-diophantine-equation/345128#345128

http://math.stackexchange.com/questions/487051/why-cant-the-alpertron-solve-this-pell-like-equation/487063#487063

http://math.stackexchange.com/questions/512621/finding-all-solutions-of-the-pell-type-equation-x2-5y2-4/512649#512649

http://math.stackexchange.com/questions/680972/if-m-n-in-mathbb-z-2-satisfies-3m2m-4n2n-then-m-n-is-a-perfect-square/686351#686351

http://math.stackexchange.com/questions/739752/how-to-solve-binary-form-ax2bxycy2-m-for-integer-and-rational-x-y/739765#739765 :::: 69 55

http://math.stackexchange.com/questions/742181/find-all-integer-solutions-for-the-equation-5x2-y2-4/756972#756972

http://math.stackexchange.com/questions/822503/positive-integer-n-such-that-2n1-3n1-are-both-perfect-squares/822517#822517

http://math.stackexchange.com/questions/1078450/maps-of-primitive-vectors-and-conways-river-has-anyone-built-this-in-sage/1078979#1078979

http://math.stackexchange.com/questions/1091310/infinitely-many-systems-of-23-consecutive-integers/1093382#1093382

http://math.stackexchange.com/questions/1132187/solve-the-following-equation-for-x-and-y/1132347#1132347 <1,-1,-1>

http://math.stackexchange.com/questions/1132799/finding-integers-of-the-form-3x2-xy-5y2-where-x-and-y-are-integers

http://math.stackexchange.com/questions/1221178/small-integral-representation-as-x2-2y2-in-pells-equation/1221280#1221280

http://math.stackexchange.com/questions/1404023/solving-the-equation-x2-7y2-3-over-integers/1404126#1404126

http://math.stackexchange.com/questions/1599211/solutions-to-diophantine-equations/1600010#1600010

http://math.stackexchange.com/questions/1667323/how-to-prove-that-the-roots-of-this-equation-are-integers/1667380#1667380

http://math.stackexchange.com/questions/1719280/does-the-pell-like-equation-x2-dy2-k-have-a-simple-recursion-like-x2-dy2

http://math.stackexchange.com/questions/1737385/if-d1-is-a-squarefree-integer-show-that-x2-dy2-c-gives-some-bounds-i/1737824#1737824 "seeds"

http://math.stackexchange.com/questions/1772594/find-all-natural-numbers-n-such-that-21n2-20-is-a-perfect-square/1773319#1773319

Is there a simple proof that if $(b-a)(b+a) = ab - 1$, then $a, b$ must be Fibonacci numbers? 1,1,-1; 1,11

To find all integral solutions of $3x^2 - 4y^2 = 11$

Will Jagy
  • 139,541