OFFSET
0,15
COMMENTS
The zero digits are preserved, but after the other digits have been changed leading zeros are of course omitted.
LINKS
Michel Marcus, Table of n, a(n) for n = 0..10000
EXAMPLE
a(23) = 12, since 23 mod 2 is 1, 23 mod 3 is 2.
a(24) = 0, since both 24 mod 2 and 24 mod 4 are 0.
a(25) = 10 since 25 mod 2 is 1, 25 mod 5 is 0.
MATHEMATICA
a[0] = 0; a[n_] := FromDigits[Mod[n, IntegerDigits[n]/.{0->n}]]; Array[a, 100, 0] (* Amiram Eldar, Sep 13 2021 *)
PROG
(PARI) a(n) = my(d=digits(n)); fromdigits(vector(#d, k, if (d[k], n % d[k], 0))); \\ Michel Marcus, Sep 13 2021
(Python)
def A347323(n): return int(''.join('0' if d == '0' else str(n % int(d)) for d in str(n))) # Chai Wah Wu, Sep 13 2021
CROSSREFS
KEYWORD
AUTHOR
N. J. A. Sloane, Sep 13 2021
EXTENSIONS
More terms from Stefano Spezia, Sep 13 2021
STATUS
approved