A347323 Replace each nonzero digit d of n by (n mod d).
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
Examples
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.
Links
- Michel Marcus, Table of n, a(n) for n = 0..10000
Crossrefs
Suggested by A346576.
Programs
-
Mathematica
a[0] = 0; a[n_] := FromDigits[Mod[n, IntegerDigits[n]/.{0->n}]]; Array[a, 100, 0] (* Amiram Eldar, Sep 13 2021 *)
-
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
Extensions
More terms from Stefano Spezia, Sep 13 2021
Comments