Minimum number of cubes of integers that sum upto a natural number n

We define $f(x) =$ minimum number of positive perfect cubes that sum up to $x$.
For example,$$f(17) = 3(17 = 1^3 + 2^3 + 2^3)$$ $$f(9) = 2 (9 = 1^3 + 2^3)$$ How can we find $f(x)$ for any number $x$?

• Are you familiar with the Waring Problem? An exact solution isn't known for all $x$, but good upper bounds are known. – Steven Stadnicki Jun 30 '17 at 18:41
• @DietrichBurde Not a duplicate. That was about $\max_x f(x)$. Here we want to compute $f(x)$ for any given $x$. – Robert Israel Jun 30 '17 at 18:52
• @RobertIsrael Oh, sorry, this was a mistake. Still, this page is relevant. For example, $f(23)=9$. – Dietrich Burde Jun 30 '17 at 18:52
• You might look at OEIS sequence A002376 and links there. – Robert Israel Jun 30 '17 at 19:04
• $G(3)=9$ so the $1 \leq f(x) \leq 9$. – Ahmad Jun 30 '17 at 19:10