Questions on perfect squares
I recently attended a test which ask me two question based on perfect squares; here they are:
$1.$ How many even perfect squares between $1000$ and $5000$ are divisible by both $5$ and $9$?
$2.$ Can there be a perfect square whose digits consists of exactly $4$ ones, $4$ twos and $4$ zeroes in any order?
I haven't done anything much on perfect squares so I was reluctant to attempt them during exams, although as I had some spare time after finishing the other questions, I tried thinking about the first problem and I noticed that only $3600$ seems to satisfy the conditions, which is correct, but I don't know how to get this mathematically? And for the second problem, I don't have any clue till now.
Unfortunately they haven't given me any solutions for the questions, nor any ideas as to how to solve them (mathematically)?
For 1) Try to find all $k$ such that
$$ 1000 \leq 2\times 2 \times 5\times 5 \times 9 \times k^2 \leq 5000$$
For 2)
Any such number is divisible by $3$, but not by $9$ (look at the sum of digits, which gives the remainder upon dividing by $3$ and $9$).
In both, we are using the fact that if a prime $p$ divides $n^2$, then so does $p^2$.
Edit: I wrongly applied the method of casting-out nines, but there may be part of my original post worth keeping (with some rewriting); specifically, I have the impression that the OP, maybe others, may gain something by seeing the basic modular arithmetic underlying the answers that I laid out, and how it is used. I invite comments.
EDIT One method used to answer is that of congruence; the most effective method is the one used in other posts, of using congruence mod9; I I will illustrate the method mod10 , whereby a perfect square must have a right-most digit ending in 0,1,4,5,6,9 . You can apply/adapt the same to the case mod9 used by Aryabhat and others. The innefectiveness of using mod10 here is that it does not exclude as squares those digits ending in either 0 or 1. So I will just show how/why we can use this method dismiss numbers ending in 2 as possible squares.
Mod10 Another ex 2 is this: when working $mod10$, the only possible remainders of a square are 0,1,4,5,6,9, but not 2,3 or 7, and your number with 4 0's 4,1's, and 4 2's will be congruent to: $4(1)+4(0)+4(2)=2 mod10$
For a quick proof of this last fact:
$0^2$ is 0(mod10)
$1^2$ is 1(mod10)
$2^2$ is 4(mod10)
$3^2$ is 9(mod10)
$4^2$ is 6(mod10)
$5^2$ is 5(mod10)
and 6,7,8,9, are respectively 6,9, 4, 1 mod 10.
And if k>10 , then write k=10c+a , with a<10, e.g., 357=35(10)+7 , then:
$(10c+a)^2=100c^2+2(10)+a^2 $ is $a^2 mod 10$, but the case of a has already been covered.
Answer to Ques. 1 is: Only one such perfect square, i.e. 3600. Here we need to find perfect squares divisible by 4x9x25=900.
Answer to Ques. 2 is: No. Because taking the square root of the lowest and the highest 12 digit numbers we get 317200 and 1000000, that means we cannot start with a number say 1012. Hence No.