Find the sum of all positive integers whose squares are of the form , a five digit number with and as digits.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
There are only 9 0 numbers of the form n = A B A B A , so it's easy to check all of these with a few lines of code; however, we can narrow down the possibilities a bit, and actually solve this by hand.
The last digit of a square must be one of 0 , 1 , 4 , 5 , 6 , 9 , so A is one of these. We can eliminate A = 0 as this would not give a five-digit number.
Now note that n = 1 0 1 0 1 A + 1 0 1 0 B , and that 3 , 7 and 1 3 are all factors of 1 0 1 0 1 .
n ≡ 2 B ( m o d 3 ) . All squares are congruent to either 0 or 1 ( m o d 3 ) , so this means B ∈ { 0 , 2 , 3 , 5 , 6 , 8 , 9 } .
Likewise, n ≡ 2 B ( m o d 7 ) . All squares are congruent to either 0 , 1 , 2 or 4 ( m o d 7 ) , so this means B ∈ { 0 , 1 , 2 , 4 , 7 , 8 , 9 } .
By looking at quadratic residues ( m o d 1 3 ) we find that B ∈ { 0 , 1 , 3 , 4 , 9 } .
Checking which numbers are in all of these sets, we find B ∈ { 0 , 9 } .
If the last digit of a square is 5 , its penultimate digit must be 2 ; but this isn't an option for B , so we have A ∈ { 1 , 4 , 6 , 9 } .
This only leaves eight possibilities; we can reduce these even further by looking at each of them ( m o d 8 ) (the quadratic residues are 0 , 1 , 4 ). This only leaves two viable options, 4 0 4 0 4 and 6 9 6 9 6 . But 4 0 4 0 4 = 4 ⋅ 1 0 1 0 1 and 1 0 1 0 1 ≡ 5 ( m o d 8 ) , so 4 0 4 0 4 is not a square.
Finally there is only one possibility, 6 9 6 9 6 ; checking this we find it is the square of 2 6 4 .