IMO 1962 Q1 #
Find the smallest natural number $n$ which has the following properties:
(a) Its decimal representation has 6 as the last digit.
(b) If the last digit 6 is erased and placed in front of the remaining digits, the resulting number is four times as large as the original number $n$.
Since Lean does not explicitly express problems of the form "find the smallest number satisfying X", we define the problem as a predicate, and then prove a particular number is the smallest member of a set satisfying it.
Equations
- Imo1962Q1.ProblemPredicate n = ((Nat.digits 10 n).headI = 6 ∧ Nat.ofDigits 10 ((Nat.digits 10 n).tail.concat 6) = 4 * n)
Instances For
First, it's inconvenient to work with digits, so let's simplify them out of the problem.
Now we can eliminate possibilities for (digits 10 c).length
until we get to the one that works.
linarith
fails on numbers this large, so this lemma spells out some of the arithmetic
that normally would be automated.
Now we combine these cases to show that 153846 is the smallest solution.