Suppose a two digit whole number is divided by the sum of its digits, largest and smallest possible values

Suppose a two digit whole number is divided by the sum of its digits, what are the largest and smallest possible values? So we can write a two digit whole number as $$n = 10a+b$$ where $$1 \leq a,b \leq 10$$ and we would have that we want to minimize/maximize the following functions:

$$f(a,b) = 10a+b$$

$$g(a,b) = a+b$$

I don't remember how one does this and I don't know if there is another approach that could work.

• you say $1\le b,$ so multiples of $10$ are excluded? there aren't so many two-digit numbers, so trial and error is not prohibitive – J. W. Tanner Nov 19 '19 at 5:35
• My mistake, should be $0 < a <10$ and $0\leq b < 10$. I know that trial and error is a possible way to do this but I was hoping to find a method that could generalize to n digits. – ElPerroBermudez Nov 19 '19 at 5:54

Write the ratio you are interested in $$\frac {10a+b}{a+b}=1+\frac {9a}{a+b}=10-\frac {9b}{a+b}$$ To make this large you want $$a$$ large and $$b$$ small. If you allow $$b=0$$ this becomes $$10$$ regardless of $$a$$. If you do not allow $$b=0$$ the maximum comes at $$91$$ with $$\frac {91}{10}=9.1$$. To make it small you want $$b$$ large and $$a$$ small, but we cannot have $$a=0$$, so the minimum is $$19$$ with $$\frac {19}{10}=1.9$$