Problem

Source: St. Petersburg 2023 9.5

Tags: algebra



For a positive integer $n$ and a nonzero digit $d$, let $f(n, d)$ be the smallest positive integer $k$, such that $kn$ starts with $d$. What is the maximal value of $f(n, d)$, over all positive integers $n$ and nonzero digits $d$?