If the digits are all distinct and there are b digits for a 3 digit number we have (we don't start numbers with the digit 0)
(b-1)(b-1)(b-2) = 100
This has 1 real solution, b=6
For number 2 recall Fermat's Little Theorem says \(a^{p-1}\equiv 1 \pmod{p} \text{ for p prime, a a positive integer.}\)
so \(5^6 \equiv 1 \pmod{7}\)
\(5^{30}=\left(5^6\right)^5 \equiv 1^5 \pmod{7} = 1^5 = 1\)