# Let $T$ be the function that sum the digits of an integer $n$. Let $a (n)$ be the number of times we must apply $T$ to an integer n to a fixed point.

I'm currently working in the following exercise:

Let $$T$$ be the function that sum the digits of an integer $$n$$. Let $$a (n)$$ be the number of times we must apply $$T$$ to an integer n so that it becomes a fixed point. For example $$a(452) = 2$$, since $$T (452) = 11$$, $$T (11) = 2$$, $$T (2) = 2$$. So we must apply twice T to get to the fixed point $$2$$. Find the smallest positive integer $$n$$ such that $$a (n) = 3$$. Find the smallest positive integer n such that $$a (n) = 4$$.

I've been trying descomposition in prime factors so that could help me to find the numbers required to find the answer but that option is not working. If anyone has a hint or any help will be really appreciated.

• Prime factors has nothing to do with this. Find the smallest so that $a (n)=1$. That's clearly $10$. Find the smallest where $a(n)=2$ which is the smallest where the digits add to 10. That's clearly $19$ and so the smallest where $a (n)=3 is the smallest where the digits add to$19\$ and that's 199. So the smallest where a (n)=4 will be the smallest where the digits add to 199. (It will have at least 22 digits so prime factors is definitely a useless idea). – fleablood Jan 30 at 2:50

Prime factorizations don't matter, digits do. So look at the smallest number such that $$a(n)>0$$.
Note that $$T(d)=d$$ for all single digits $$d$$, so try $$T(10)=1$$, so $$a(10)=1$$.
Going from here, we now know that if $$T(n)=10$$, then $$a(n)=2$$, since 10 is not a fixed point. To do that, simply make the digits sum to 10, and make the smallest number possible, which is $$19$$.
Next, if $$T(n)=19$$ then we know $$a(n)=3$$. I'll leave you to figure out what the smallest number that has a digit sum of 19 is.