I was wondering if it was possible to, say, have function $f$ that would return the number of digits in any given positive integer. I tried using some sort of a summation, but that failed quite miserably.
Using piecewise equations, it might be constructed something like this: $$f(x)=\begin{cases}1 & \text{ if } x=1 \\2 & \text{ if } x=52 \\3 & \text{ if } x=230 \\4 & \text{ if } x=5023\\\vdots&\text{ }\vdots\end{cases}$$ This is, however, not what I want. Instead, I would like, if possible, some mathematical way of doing this.