21. Peter has a lock with a three-digit code. He knows that all the digits of his code are different and that if he divides the second digit by the third and then squares his answer, he will get the first digit. What is the difference between the largest and smallest possible codes?
A 42
B 468
C 499
D 510
E 541
21. E The digits in the code are all different, so the result of dividing the second digit by the third cannot be 1 . The first digit is a square number and, since it cannot be 1 , is 4 or 9 . The largest possible code will start with 9 and have second digit $\div$ third digit $=3$ and is 962. The smallest possible code will start with 4 and have second digit $\div$ third digit $=2$ and is 421 . Hence the difference between the largest and smallest possible codes is $962-421=541$.