For each positive integer $n$, let $f(n)$ be the sum of the digits in the base-three representation of $n$ and let $g(n)$ be the sum of the digits in the base-six representation of $f(n)$. For example, $f(2024) = f(2202222_{\text{3}}) = 12 = 20_{\text{6}}$, and $g(2024) = \text{the digit sum of }20_{\text{6}} = 2$. Let $N$ be the least value of $n$ such that the base-twelve representation of $g(n)$ cannot be expressed using only the digits $0$ through $9$. Find the remainder when $N$ is divided by $1000$.
← Back to Problem 658