OFFSET
1,4
COMMENTS
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
MATHEMATICA
hQ[n_] := ! MemberQ[(d = IntegerDigits[n]), 0] && Divisible[n, Plus @@ d]; a[n_] := Module[{m= (10^n - 1)/9, k=0}, While[! hQ[m+k], k++]; k]; Array[a, 30] (* Amiram Eldar, Oct 13 2021 *)
PROG
(Python)
def a(n):
s, k = "1"*n, int("1"*n)
while '0' in s or k%sum(map(int, s)): k += 1; s = str(k)
return k - int("1"*n)
print([a(n) for n in range(1, 73)]) # Michael S. Branicky, Oct 12 2021
(PARI) a(n) = my(r=(10^n-1)/9); for(k=r, 10^n-1, if (vecmin(digits(k)) && !(k % sumdigits(k)), return (k-r))); \\ Michel Marcus, Oct 13 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Oct 12 2021
EXTENSIONS
a(23) and beyond from Michael S. Branicky, Oct 12 2021
STATUS
approved