Problem

Source: Cono Sur Olympiad 2016, problem 4

Tags: number theory, cono sur



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$.