I have always wondered about a math problem that I have been unable to find information about.
What is the smallest sum of $\{a,b,c\}$ such that $ab+c$ equals any natural number $N$.
Here are some examples.
$$0*0+1 = 1\\ 0*0+2 = 2\\ 0*0+3 = 3\\ 2*2+0 = 4\\ 2*2+1 = 5\\ 2*3+0 = 6$$
As the pattern continues, the sum of $a$, $b$, and $c$ get smaller relative to $N$.
So, for any natural number $N$, how could you calculate the smallest sum (without brute force)?
$$a + b + c = a + b - ab + N = N + 1 - (a-1)(b-1),$$ so you need the product $(a - 1) (b - 1)$ to be as large as possible compatibly with $a b \le N$. So it seems to me you should take the biggest square $d^{2} \le N$, and then take either $a = b = d$, or $a = d, b = d+1$ if $d^{2} + d \le N$, or $a = d, b = d+2$ if $d^{2} + 2 d \le N$.
For instance with $N = 4$ you take $a = b = 2$, when $N = 6$ you take $a = 2, b = 3$, when $N = 8$ you take $a = 2, b = 4$.