All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Near Pythagoras (Posted on 2013-07-31) Difficulty: 3 of 5
Determine all possible pairs (x,y) of half-integers, with x ≤ y, that satisfy this equation:

[x2] + [y2] = 2016

Prove that there are no others.

*** [x] denotes the greatest integer ≤ x.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 4

   10   for X=1 to 5000 step 2
   20    for Y=X to 5000 step 2
   30       T=int(X*X//4)+int(Y*Y//4)
   40       if T=2016 then print X//2,Y//2
   50    next
   60   next
  110   for X=-1 to -10000 step -2
  120       Term1=int(X*X//4)
  130       Term2=2016-Term1
  140       Ysq=Term2+1//4
  150       Num=Ysq*4
  160       Y=int(sqrt(Num)+0.5)
  170       if Y*Y=Num then print X//2,Y//2
  180   next

finds

   x         y
 29/2   85/2
 55/2   71/2
-29/2   85/2
-55/2   71/2
-71/2   55/2
-85/2   29/2

before running out of real answers and crashing with:

Illegal parameter in 160

The program uses variables x and y to represent twice x or y.


  Posted by Charlie on 2013-07-31 18:13:43
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information