Welcome to MindCipher, a social repository of the world's greatest brain teasers, logic puzzles and mental challenges.

The double-square number problem

It's said that a number N with 4 digits is a double-square number when it equals the sum of the squares of two numbers: one formed by the first two digits of N, in the order they appear in N and the other formed by the two last digits of N in the order they appear in N.

For example, 1233 is a double-square number since 1233 = 12^2 + 33^2. Find another double-square number.

Placing the problem into an equation:

x^2 + y^2 = 100x + y, this is one equation for two variables. It's looks unsolvable, and this is precisely the hard part of the problem, because we naturally tend to forget that we already have one solution to this equation which is 1233. If you replace x = 12 you'll end up with:

y^2 - y - 1056 = 0, this case leads nowhere since delta < 0. But if you replace y = 33, then you'll have:

x^2 - 100x + 1056 = 0, this case gives you the problem's suggested solution 1233 and another one since delta > 0, which is 88 composing the answer 8833.



Very good answer - this seems impossible at first...


watch this also https://youtu.be/tWztTPvtVbo


watch this also


Chris van Egmond

Brute force programmatic solution in Python:

from math import pow [n for n in range(1000,10000) if pow(n/100,2)+pow(n%100,2)==n]



Nice, although brute forcing ruins all the fun! :)

In general, the space of solutions to this problem lie on the circle defined by 100x+y = x^2 + y^2. Here it is on WolframAlpha.


Chris van Egmond

Yeah I suppose I have to agree with you that a mathematical model is definitely nicer!


If the number isn't restricted to 4 digits, then we have a very easy solution: 10100 :D


was easy..

Check out other puzzles:

Like this? You might also like:
Two Trains
Interview Question - Databases
Submitted by
about 5 years ago
Difficulty 8.1 ?

Math mathematics