OFFSET
0,3
LINKS
PROG
(PARI) a(n) = my (v=0, k=1, r=2, p=1); while (n, my (d=n % r); if (d, my (t = lift(Mod(d, r)/Mod(k, r))); v += t * p; k *= t); n \= r; p *= r; r = nextprime(r+1)); return (v)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jun 01 2018
STATUS
approved