Let $S(n)$ be the sum of the digits of the positive integer $n$. Find all $n$ such that $S(n)(S(n)-1)=n-1$.
Problem
Source: Cono Sur Olympiad 2016, problem 4
Tags: number theory, cono sur
28.08.2017 22:19
I can't understand your last equation. Could you check?
28.08.2017 22:30
I'm sorry, It's correct now.
29.08.2017 00:27
Assume that $10^{k-1}\leq n<10^k$ for some positive integer $k$. This means that $n$ has exactly $k$ digits. Therefore: $S(n)\leq 9k\implies 10^{k-1}-1\leq n-1=S(n)(S(n)-1)\leq 9k(9k-1)\implies 10^{k-1}-1\leq 9k(9k-1)$. The last inequality holds if and only if $k=1,2,3,4 \implies n<10000$. Now assume that $n$ has $4$ digits. Then since $LHS\leq 36\times 35$ then $n\leq 36\times 35+1=1261$. Since we assumed that $n$ has $4$ digits it begins with $1$. This implies that $S(n)<1+9+9+9=28$ and again $n<28\times 27+1=757$ which is absurd. Assume now that $n$ has $3$ digits or less. Then $S(n)\leq 27$. So we only have to obtain $27$ cases obtaining the following solutions: $n=\{1,13,43,91,157\}$.
29.08.2017 00:33