Originally Posted by

**Soroban** Hello, grasmanek94!

I'll assume that we are dealing with integers (whole numbers).

Given a number $\displaystyle N$:

. . (1) Divide by 10 * and note the remainder.

. . (2) Add 20 to the remainder.

$\displaystyle \text{Example: }73$

. . $\displaystyle 73 \div 10 \:=\:7\text{, rem. }3$

. . $\displaystyle \text{Then: }3 + 20 \:=\:23$

$\displaystyle \text{Example: }198$

. . $\displaystyle 198 \div 10 \:=\:19\text{, rem. }8$

. . $\displaystyle \text{Then: }8 + 20 \:=\:28$

$\displaystyle \text{Example: }850$

. . $\displaystyle 850 \div 10 \:=\:85\text{, rem. }0$

. . $\displaystyle \text{Then: }0 + 20 \:=\:20$

* $\displaystyle \text{The "10" is the difference }30\!-\!20.$