Problem 1
George is attempting to break into a safe in a bank, though he doesn't know the combination. However, the lock is very peculiar and will accept any code (of any length) with the following properties:
(i) It consists only of the digits $0$-$9$
(ii) The string ‘$a_1a_2...a_n$’ of digits appears in the code
(iii) The code is a perfect $7$th power
For example, if the string was ‘$638$’ then $16384=4^7$ would unlock the safe (as would many other codes).
Fortunately, George knows the string ‘$a_1a_2...a_n$’ that he must include. Prove that there is always at least one code that unlocks the safe.
Hint 1
Suppose you start with the number ‘$a_1a_2..a_nb_1b_2...b_k$’ for some $b_i$s.
Hint 2
Suppose $m^7<$ ‘$a_1a_2..a_nb_1b_2...b_k$’ $<(m+1)^7$. Can you adjust the code to make it a $7$th power?
Hint 3
$\log_{10}($a number$)\approx$ the number of digits of the number.
Solution
We need the code to satisfy both (ii) and (iii). One option is to start with a $7$th power and then hope it contains the string ‘$a_1a_2...a_n$’. However, there is no easy way to control the digits of the $7$th power of a number: if we start with $321$ (say), the only way to tell what digits its $7$th power includes is to calculate it, at which point we are just guessing.
Instead, therefore, let us start with a code satisfying (ii) and try to make it satisfy (iii). Take ‘$a_1a_2..a_nb_1b_2...b_k$’ to be our code, for some $b_i$s and $k$. We want this to be a $7$th power but it probably won't be. Let's say instead that $m^7<$ ‘$a_1a_2..a_nb_1b_2...b_k$’ $<(m+1)^7$.
Crucially, while this code is not yet a $7$th power, it is pretty close. As the $b$s are irrelevant to whether or not the code works, we can try to adjust them to make the code a $7$th power by adding whatever its difference from $(m+1)^7$ is.
The only problem is that by adding this difference, we may be affecting some of the $a$s; we need the difference to be small enough not to impact them. So that we can add as large a quantity as possible, without disrupting the $a$s, take all the $b$s to be $0$ so the code is ‘$a_1a_2..a_n00...0$’ with $k$ $0$s after $a_n$.
We want the difference we are adding to affect at most the first $k$ digits of the code, so we want the difference itself to have at most $k$ digits. Similarly, we know $m^7$ and $(m+1)^7$ have (roughly) $n+k$ digits. Note that $\log_{10}($a number$)\approx$ the number of digits of the number; the error is always $\leq1$.
So we know $\log_{10}m^7=7\log_{10}m\approx n+k$ and we want $\log_{10}((m+1)^7-m^7)<k$. But $\log_{10}((m+1)^7-m^7)=\log_{10}(7m^6+21m^5+...+1)<\log_{10}(7m^6+m^6+...+m^6)$ for large enough $m$. This is $=\log_{10}(13m^6)=\log_{10}(13)+6\log_{10}m\approx 6\log_{10}m$ because $\log_{10}(13)\approx1$ which is negligible for large $m$. So we want $6\log_{10}m<k$ and $7\log_{10}(n+k)\approx n+k$.
Many solutions will work. For example, let's take $k=6.5\log_{10}m$ and $n=0.5\log_{10}m$. Then, by eliminating $m$, we find $k=13n$. Therefore, if we take ‘$a_1a_2...a_n00...0$’ where there are $13n$ $0$s following $a_n$, then we can add an adjustment to make our code a $7$th power without affecting the $a$s, meaning we get a code that works, regardless of the string ‘$a_1a_2...a_n$’. In fact, as can be readily seen, there are infinitely many codes that work.
Extensions
Can you write a rock-solid argument to prove this by dealing with the approximations (like $\log_{10}($a number$)\approx$ the number of digits of the number) rigorously?
Suppose condition (iii) is changed so that instead of a $7$th power, we want the code to $=c_nx^n+c_{n-1}x^{n-1}+...+c_o$ for integers $c_i$ and $x$. Can you adapt the argument?
What if, instead of polynomials, we require the code to be within $1$ of $e^x$ for an integer $x$?