# Lucky Lattice Points [closed]

How many lattice points lie on the sphere given by following equation ? $$x^2+y^2+z^2=2013$$

Hint: A lattice point has integer coordinates.

-

## closed as off-topic by Jonas Meyer, hardmath, Newb, Michael Albanese, Zev ChonolesApr 4 at 4:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Jonas Meyer, hardmath, Newb, Michael Albanese, Zev Chonoles
If this question can be reworded to fit the rules in the help center, please edit the question.

Almost possible duplicate? (or at least related) math.stackexchange.com/questions/86178/… .... basically, I am not sure there is too much of an easy way of doing this –  mathguy Apr 7 '13 at 15:05
This is a verbatim copy of a current problem on brilliant.org. –  Erick Wong Apr 7 '13 at 15:09
@mathguy ya i saw that but it helped a lot so i posted this .. –  Prateek Apr 7 '13 at 15:16
@ErickWong i know but i posted it here because even though i was entering the right ans it was not accepting ... –  Prateek Apr 7 '13 at 15:18
@Prateek People on this website hate if you only post a question without showing any actual work that you have done yourself (hence the downvotes). It'll make others feel like they are doing all the work for you, even if you claim you tried something. Also I think there is some guideline about not posting questions from ongoing competitions. You should really go over the rules –  mathguy Apr 7 '13 at 15:24

I am guessing the deadline is past, as this question is not locked, also today is the 14th. It would help in future to know the deadline as it is in the MSE date/clock, which I think is on GMT.

We have $4 \cdot 2013 = 8052$ and $h(-8052)=16.$ Since $2013= 3 \cdot 11 \cdot 61$ is squarefree, all representations are primitive. Since $2013 \equiv 5 \pmod 8,$ we get $$12 h(-4 \cdot 2013) = 12 \cdot h(-8052) = 12 \cdot 16 = 192.$$ So that's the answer, there are 192 integral representations.

NOTE: below, @adam W gives an answer with each $0 \leq x \leq y \leq z.$ If one of these satisfies $1 \leq x < y < z,$ it actually contributes 48 solutions to the total, owing to permutations ($3! = 6$) times $\pm$ signs ($2^3 = 8$).

Below is the class group. The shorthand $\langle 1, 0, 2013 \rangle$ refers to the positive binary quadratic form $$f(x,y) = a x^2 + b x y + c y^2.$$

Full list: $$\langle 1, 0, 2013 \rangle, \langle 2, 2, 1007 \rangle, \langle 3, 0, 671 \rangle, \langle 6, 6, 337 \rangle,$$ $$\langle 11, 0, 183 \rangle, \langle 19, -2, 106 \rangle, \langle 19, 2, 106 \rangle, \langle 22, 22, 97 \rangle,$$ $$\langle 31, -16, 67 \rangle, \langle 31, 16, 67 \rangle, \langle 33, 0, 61 \rangle, \langle 38, -2, 53 \rangle,$$ $$\langle 38, 2, 53 \rangle, \langle 41, -36, 57 \rangle, \langle 41, 36, 57 \rangle, \langle 47, 28, 47 \rangle.$$

The principal genus is $\langle 1, 0, 2013 \rangle, \; \langle 22, 22, 97 \rangle.$ From a 1973 article by Estes and Pall, the spinor kernel (fourth powers in the group) is just $\langle 1, 0, 2013 \rangle.$

The relationship between (primitive) representations by the ternary form and class number for a discriminant of binary forms is due to Gauss. See, for example. Emil Grosswald, Representations of Integers as Sums of Squares, Chapter 4, but especially section 8, pages 51-53, Gauss's Theorem.''

=-=-=-=-=

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$date Sun Apr 14 16:31:24 PDT 2013 jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./classGroup
Absolute value of discriminant?
8052
class  number  16

all
( 1, 0, 2013)
( 2, 2, 1007)
( 3, 0, 671)
( 6, 6, 337)
( 11, 0, 183)
( 19, -2, 106)
( 19, 2, 106)
( 22, 22, 97)
( 31, -16, 67)
( 31, 16, 67)
( 33, 0, 61)
( 38, -2, 53)
( 38, 2, 53)
( 41, -36, 57)
( 41, 36, 57)
( 47, 28, 47)

squares
( 1, 0, 2013)
( 22, 22, 97)

fourths
( 1, 0, 2013)

Discriminant      -8052     h :   16     Squares :    2     Fourths :    1
jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus\$


=-=-=-=-=

-
@Calvin Lin, is the deadline for this one up? –  Will Jagy Apr 14 '13 at 23:42

Up to ordering, there are four: \begin{array}{ccc} x & y & z \\ \hline \\ 4 & 29 & 34 \\ 2 & 28 & 35 \\ 13 & 20 & 38 \\ 8 & 10 & 43 \\ \end{array}

This was found by exhaustive search using python, it did not take much time at all by limiting the loops:

for x in range(2014):
for y in range(2014-x*x):
for z in range(2014-x*x-y*y):
if x*x + y*y + z*z == 2013:


Where the upper limit is incremented by one since range objects in python do not reach the end limit you give them.

Here is another way:

 for x in range(45):
for y in range(x,int(math.sqrt(2013-x*x))+1):
for z in range(y,int(math.sqrt(2013-x*x-y*y))+1):
if x*x + y*y + z*z == 2013:
print(x,y,z)

-
thanks ... but is there any method other than brute force ?? –  Prateek Apr 7 '13 at 14:44
Up to ordering and change of signs :)? –  Alex J Best Apr 7 '13 at 14:46
I was afraid that you were asking that :) After some time you can edit that into your question to get the question bumped to the front page again if no answers come along in the meantime. –  adam W Apr 7 '13 at 14:48
@Alex yes, signs too, good catch. –  adam W Apr 7 '13 at 14:48
This problem is taken from Brilliant, as is all the other posts from this user. I request that you hide the discussion for a week - Calvin Lin, Brilliant Challenge Master. –  Calvin Lin Apr 7 '13 at 15:36