OFFSET
1,1
LINKS
Max Alekseyev, Table of n, a(n) for n = 1..30
PROG
(PARI) { A246757(n) = my(m, d, p, q); m=n\2; forstep(k=10^m-1, (10^m-1)/9, -1, d=digits(k); q=prod(i=1, #d, d[i]); if(q==0, next); forstep(s=(((k+1)*10^(n-m))\q)*q, k*10^(n-m), -q, d=digits(s); p=prod(i=1, #d, d[i]); if(p==0 || s%p, next); return(s) )) }
(Python)
from operator import mul
from functools import reduce
def A246757(n):
for i in range(10**n-1, int('1'*n)-1, -1):
pd = reduce(mul, (int(d) for d in str(i)))
if pd and not i % pd:
return i # Chai Wah Wu, Sep 08 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Max Alekseyev, Sep 02 2014
STATUS
approved