Compute the largest integer between $1$ and $1000$ whose base $5$ representation consists of the last $k$ digits of its base $2$ representation, for some $k$.
I thought about taking cases based on the number of leading $1$s such a number $n$ has in base $5$. Since $1000 = 13000_5$, there are many possibilities to check using this approach. For example, if the number of leading $1$s is $1$, then \begin{align*}n &= 10_5, 100_5,101_5,1000_5,1010_5,1011_5,1001_5,10000_5,10001_5,10010_5,10011_5,10100_5,10101_5,\\&=10110_5,10111_5.\end{align*}
The number of cases here is $2^0+2^1+2^2+2^3 = 15$. Then we would also have to check if each of these satisfies the requirements.