login
A347323
Replace each nonzero digit d of n by (n mod d).
4
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 4, 3, 2, 1, 0, 10, 0, 12, 0, 10, 2, 16, 4, 12, 0, 10, 20, 0, 12, 20, 0, 12, 26, 3, 0, 10, 20, 31, 0, 10, 24, 35, 0, 14, 0, 10, 20, 32, 42, 0, 12, 21, 32, 45, 0, 10, 20, 30, 40, 50, 0, 14, 24, 36, 0, 10, 20, 31, 42, 50
OFFSET
0,15
COMMENTS
The zero digits are preserved, but after the other digits have been changed leading zeros are of course omitted.
LINKS
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
Suggested by A346576.
Sequence in context: A067458 A088330 A376252 * A324471 A346576 A122512
KEYWORD
nonn,base,look
AUTHOR
N. J. A. Sloane, Sep 13 2021
EXTENSIONS
More terms from Stefano Spezia, Sep 13 2021
STATUS
approved