What exactly does this notation mean when using it to define a function?
$f(x) = f(\text{ sum of the digits of }x) \{ \mathrm{if}( x \ge 10) \} = x \{ \mathrm{if}( x \lt 10) \} $
Thanks
What exactly does this notation mean when using it to define a function?
$f(x) = f(\text{ sum of the digits of }x) \{ \mathrm{if}( x \ge 10) \} = x \{ \mathrm{if}( x \lt 10) \} $
Thanks
It means that which formula applies depends on which condition holds. Explicilty, it is equivalent to $f(x) = \left\{\begin{array}{ll} f(\mbox{sum of the digits of $x$}) &\mbox{if $x\geq 10$}\\ x &\mbox{if $x\lt 10$.} \end{array}\right.$ which recursively defines the function for every positive integer.
For example, if $x=481754$, then $x\geq 10$, so \begin{align*} f(x) &= f(481754) = f(4+8+1+7+5+4)\\ &= f(29) = f(2+9)\\ &= f(11) = f(1+1)\\ &= f(2) = 2. \end{align*}
This is the function that reduces an integer to its residue class modulo $9$ ("casting out nines"), using $9$ as the representative for the multiples of $9$ (instead of $0$).
If $x\lt 10$, $f(x)=x$
If $x \ge 10$, to get $f(x)$ add up the digits of x, presumably in base 10, then repeat until you get below 10.
So for example, $f(6)=6, f(18)=9, f(987)=f(24)=6, f(1234)=f(10)=1$