Problem:
A six digit number (base 10) is squarish if it satisfies the following conditions:
(i) none of its digits is zero;
(ii) it is a perfect square; and
(iii) the first of two digits, the middle two digits and the last two digits of the number are all perfect squares when considered as two digit numbers.
How many squarish numbers are there?
Answer Choices:
A. 0
B. 2
C. 3
D. 8
E. 9
Solution:
If N is squarish, then there exist single digit positive integers A,B,C,a,b,c such that
N=104A2+102B2+C2=(102a+10b+c)2.
The quantity d=10b+c is less than or equal to 99. Thus A=a, for otherwise
N​=(102a+d)2⩽104a2+2(100)99a+(99)2<104a2+2(10)4a+104=104(a+1)2⩽N.​
Thus
8181⩾102B2+C2=​(102a+10b+c)2−104a2=103(2ab)+102(b2+2ac)+10(2bc)+c2​
In particular, 2ab⩽8. Since no digit of N is zero, a⩾4. Thus either b=0 or a=4 and b=1. In the latter case,
N=(410+c)2=168100+820c+c2
Since N has no digit zero, c⩾1. But then either the middle two digits or the leftmost two digits are not a square. Thus the latter case is impossible and b=0. Therefore,
N=(102a+c)2=104a2+102(2ac)+c2.
Thus a⩾4,c⩾4 and 2ac is an even two-digit perfect square. It is now easy to check that either a=8,c=4,N=646416, or else a=4,c=8, N=166464.