Puzzle
5 minute read

Ponder This Challenge - March 2000 - Sum of two squares

Ponder This Challenge:

Let's borrow notation from LaTeX and let "^" denote exponentiation, so that x^2 means "x squared".

Consider the numbers 1233 = 12^2 + 33^2, and 990100 = 990^2 + 100^2.

Can you find an eight-digit number N with the same property, namely that if you break N into two four-digit numbers B and C, and add their squares, you recover N?

(N really has to have eight digits; its leading digit is not zero. B is the number formed by the first our digits of N, and C is the number formed by the last four digits of N.)


We will post the names of those who submit a correct, original solution! If you don't want your name posted then please include such a statement in your submission!

We invite visitors to our website to submit an elegant solution. Send your submission to the ponder@il.ibm.com.

If you have any problems you think we might enjoy, please send them in. All replies should be sent to: ponder@il.ibm.com

Solution

  • There are two different versions of the solution this month.... 1. We have N=10000B+C and N=B^2+C^2. So 10000B+C=B^2+C^2, 10000B-B^2 = C^2-C.

    Also B must lie between 1000 and 9999, in order for N to be an eight-digit number. For each trial value of B in that range, compute f(B)=10000B-B^2.

    Let c be the square root of f(B), rounded up to the nearest integer. If our equation is satisfied, we will have f(B)=c^2-c.

    (The square root of f(B) will be about C-1/2, so c=C.) So we only have to do about 9000 trials to find the lone answer: B=9412, C=2353, N = 94122353 = 9412^2 + 2353^2. 2. A few readers reminded us how to solve this problem algebraically, without exhaustive search. This write-up follows S V Nagaraj's solution.

    Continue to let "^" denote exponentiation.

    The solution is obtained by considering 10000B + C = B^2 +C^2,

    Rewriting this as 10000^2 +1 = (2B-10000)^2 +(2C-1)^2,

    we just look at the factorization of 10000^2 + 1 = 10^8 +1 = 17 *5882353.

    Express each prime factor as the sum of squares: 17 = 4^2 + 1^2 = w^2 + x^2; 5882353 = 588^2 + 2353^2 = y^2 + z^2. Then combine them according to the usual laws (related to the multiplication of complex numbers): (w^2 + x^2)(y^2 + z^2) = (wy+xz)^2 + (wz-xy)^2 (w^2 + x^2)(y^2 + z^2) = (wy-xz)^2 + (wz+xy)^2

    The second equation gives an uninteresting solution. The first gives us 4705^2 + 8824^2. Since 2C-1 is odd and 2B-10000 is even, we know which is which. 2C-1=4705 so that C=2353, and 2B-10000=8824 (or -8824) so that B is 9412 (or 588).

    B=588 is ruled out by demanding a strict 8-digit number. So the answer is B=9412, C=2353, N=94122353.

Solvers

  • Jay Patrick Howard (3.2.2000 @ 3:51 PM EST)
  • Greg Xu (3.2.2000 @ 3:51 PM EST)
  • Muppala Suresh (3.2.2000 @ 4:02 PM EST)
  • S. Muralidhar (3.2.2000 @ 4:46 PM EST)
  • Ziad Mokhtar (3.2.2000 @ 5:52 PM EST)
  • Alamuru Krishna (3.2.2000 @ 6:49 PM EST)
  • James Chan (3.2.2000 @ 10:47 PM EST)
  • Pramod G Joisha (3.2.2000 @ 10:49 PM EST)
  • Joseph DeVincentis (3.2.2000 @ 11:20 PM EST)
  • Josh Horwich (3.3.2000 @ 12:02 AM EST)
  • Dr. Ludger Weber (3.3.2000 @ 5:36 AM EST)
  • Arno Wagner (3.3.2000 @ 8:08 AM EST)
  • Ed Severn (3.3.2000 @ 8:37 AM EST)
  • msk (3.3.2000 @ 1:55 PM EST)
  • Lawrence T. Hoff (3.3.2000 @ 2:13 PM EST)
  • Jessica Lang Jones (3.3.2000 @ 2:47 PM EST)
  • Dave Bragg (3.3.2000 @ 3:27 PM EST)
  • Youngchul Park (3.3.2000 @ 4:57 PM EST)
  • John Lister (3.3.2000 @ 4:59 PM EST)
  • Dean Flatt (3.3.2000 @ 5:36 PM EST)
  • Steve Plate (3.3.2000 @ 7:56 PM EST)
  • Dave Biggar (3.3.2000 @ 11:26 PM EST)
  • Youssif A. Mohammed (3.4.2000 @ 10:53 AM EST)
  • Adel S. El-Atawy (3.4.2000 @ 12:56 PM EST)
  • Walt Gribben (3.4.2000 @ 8:56 PM EST)
  • G.Sethuraman (3.4.2000 @ 11:00 PM EST)
  • Edward Lee (3.4.2000 @ 11:20 PM EST)
  • Bill Magaletta (3.5.2000 @ 5:07 AM EST)
  • Philippe Fondanaiche (3.5.2000 @ 5:26 PM EST)
  • Dave Streek (3.6.2000 @ 5:07 AM EST)
  • Dan Peleg (3.6.2000 @ 6:52 AM EST)
  • Jose F. Martinez (3.6.2000 @ 12:29 AM EST)
  • Peter Huesken (3.6.2000 @ 11:08 AM EST)
  • Amos Guler (3.6.2000 @ 1:52 PM EST)
  • Bjørn-Ove Heimsund (3.6.2000 @ 3:00 PM EST)
  • Kishore Gangwani (3.6.2000 @ 5:20 PM EST)
  • Michael Bogomolny (3.6.2000 @ 5:21 PM EST)
  • Tom Kauffman (3.6.2000 @ 9:53 PM EST)
  • Al Zimmermann (3.6.2000 @ 11:07 PM EST)
  • Chris West (3.6.2000 @ 11:32 PM EST)
  • S V Nagaraj (3.6.2000 @ 11:28 PM EST)
  • K V Manjunath (3.7.2000 @ 1:00 AM EST)
  • Ruth Christie (3.7.2000 @ 9:06 AM EST)
  • Mihai Cioc (3.7.2000 @ 5:06 PM EST)
  • Hazem Diaa (3.7.2000 @ 5:18 PM EST)
  • Ted Carson (3.7.2000 @ 6:31 PM EST)
  • Jimmy Hu (3.7.2000 @ 7:33 PM EST)
  • Scott Lake (3.7.2000 @ 9:03 PM EST)
  • Richard Hoffman (3.8.2000 @ 9:12 AM EST)
  • S.V. Nagaraj (3.8.2000 @ 9:25 AM EST)
  • Shmuel Spiegel (3.8.2000 @ 2:30 PM EST)
  • Maria Elena Martinez (3.8.2000 @ 2:39 PM EST)
  • Greg P. Andrews (3.8.2000 @ 4:59 PM EST)
  • Akil Woolfolk (3.9.2000 @ 9:50 AM EST)
  • Gus Koumarelas (3.9.2000 @ 12:20 PM EST)
  • Anil K Sharma (3.9.2000 @ 1:04 PM EST)
  • Timur Linde (3.9.2000 @ 5:19 PM EST)
  • Ewen Cheslack-Postava (3.9.2000 @ 9:53 PM EST)
  • Duncan E Holley (3.10.2000 @ 3:59 AM EST)
  • Bruce Hoff (3.10.2000 @ 2:38 PM EST)
  • Hector Ferazza (3.10.2000 @ 5:49 PM EST)
  • Todd Sproull (3.10.2000 @ 6:56 PM EST)
  • Preeti Kelkar (3.10.2000 @ 7:17 PM EST)
  • Tat Sang Fung (3.13.2000 @ 3:56 PM EST)
  • Brad Long (3.14.2000 @ 2:49 AM EST)
  • Nicusor Timneanu (3.15.2000 @ 3:43 AM EST)
  • Brian Peltzer (3.15.2000 @ 9:40 AM EST)
  • Peter Daniel Kirchner (3.15.2000 @ 11:30 AM EST)
  • Howard Kaye (3.15.2000 @ 5:33 PM EST)
  • Mani Srinivasan (3.15.2000 @ 7:18 PM EST)
  • Dmitry O. Gorodnichy (3.15.2000 @ 7:55 PM EST)
  • David Auclair (3.15.2000 @ 9:41 PM EST)
  • Christopher James Henke (3.15.2000 @ 11:25 PM EST)
  • Sanjay Sharma (3.16.2000 @ 12:08 PM EST)
  • James Chapman (3.16.2000 @ 9:08 AM EST)
  • Ion (John) Munteanu (3.16.2000 @ 10:40 AM EST)
  • Randy Heisch (3.16.2000 @ 11:30 AM EST)
  • Shekhar Borkar (3.16.2000 @ 6:41 PM EST)
  • Bart Addis (3.16.2000 @ 1:33 PM EST)
  • Theppitak Karoonboonyanan (3.16.2000 @ 11:28 PM EST)
  • Brett Maune (3.19.2000 @ 10:44 PM EST)
  • Peter Berghmans (3.20.2000 @ 4:03 PM EST)
  • David Ralston (3/20 at 8:28 PM EST)
  • John J Scott (3/21 at 5:40 AM EST)
  • Devin Henson (3/21 at 10:19 PM EST)
  • David Becht (3/23 at 1:18 AM EST)
  • Paul Van den Keybus (3.24.2000 @ 10:59 PM EST)
  • Mingzhou Song (3.26.2000 @ 2:48 AM EST)
  • Frans Buijsen (3.27.2000 @ 8:47 AM EST)
  • Greg Bunker (3.28.2000 @ 8:10 AM EST)
  • Damian Hazen (3.28.2000 @ 8:38 AM EST)
  • Sam Warnock (3.29.2000 @ 10:42 PM EST)
  • Bill Padt (3.30.2000 @ 9:04 PM EST)
  • Jeff Ford (3.30.2000 @ 3:50 PM EST)
  • Vidya Sagar (3.31.2000 @ 6:25 AM EST)
  • Mick Legare (3.31.2000 @ 2:00 PM EST)
  • Stefan P. Hau-Riege (3.31.2000 @ 2:18 PM EST)
  • Daniel Preda (3.31.2000 @ 7:36 PM EST)
  • Omer Yagel (4.01.2000 @ 9:04 PM EST)
  • Oren Fromberg (4.02.2000 @ 8:48 PM EST)

Related posts