OFFSET
1,2
COMMENTS
Inspired by A348730 where product is replaced by sum.
The largest product of digits that an n-digit number can reach is 9^n, according to this, a(n) < 9^n; indeed a(n) < 10^n/2.
Corresponding n-digit numbers which have the largest possible remainder when divided by their digit product are in A348834.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..53
EXAMPLE
5 == 0 mod (5).
96 == 42 mod (9*6).
969 == 483 mod (9*6*9).
9997 == 4894 mod (9*9*9*7).
99998 == 47510 mod (9*9*9*9*8).
MATHEMATICA
a[n_] := Max[Mod[#, (Times @@ DeleteCases[IntegerDigits[#], 0])] & /@ Range[10^(n - 1), 10^n - 1]]; Array[a, 7] (* Amiram Eldar, Nov 01 2021 *)
PROG
(Python)
from math import prod
from itertools import product
def a(n):
maxr = 0
for p in product("123456789", repeat=n):
maxr = max(maxr, int("".join(p))%prod(map(int, p)))
return maxr
print([a(n) for n in range(1, 7)]) # Michael S. Branicky, Nov 01 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Nov 01 2021
EXTENSIONS
a(9) from Giorgos Kalogeropoulos, Nov 01 2021
a(10)-a(12) from Michael S. Branicky, Nov 01 2021
a(13)-a(21) from Chai Wah Wu, Nov 08 2021
STATUS
approved