OFFSET
0,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..18432
FORMULA
Starting from i=3, compute the remainder when n is divided by phi(i), and then continue iterating with n -> floor(n/phi(i)), and i -> i+1, until n is zero. a(n) is the sum of remainders encountered in process.
For all n >= 0, a(A231722(n)) = n.
EXAMPLE
MATHEMATICA
With[{max = 7}, bases = EulerPhi[Range[max, 1, -1]]; nmax = Times @@ bases - 1; a[n_] := Plus @@ IntegerDigits[n, MixedRadix[bases]]; Array[a, nmax, 0]] (* Amiram Eldar, Jul 29 2023 *)
PROG
(PARI) A319688(n) = { my(s=0, i=3, d, b); while(n, b = eulerphi(i); d = (n%b); s += d; n = (n-d)/b; i++); (s); };
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Oct 02 2018
STATUS
approved