q ( x ) = ∑ i = 0 I n t log x ( I n t x 10 i − 10 I n t x 10 i + 1 ) {\displaystyle \mathrm {q} (x)=\sum _{i=0}^{\mathrm {Int} \log x}\left(\mathrm {Int} {\frac {x}{10^{i}}}\ -\ 10\mathrm {Int} {\frac {x}{10^{i+1}}}\right)}