This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A348150 #38 Mar 31 2023 09:18:15 %S A348150 1,12,111,1116,11112,111114,1111112,11111112,111111111,1111111125, %T A348150 11111111112,111111111126,1111111111116,11111111111114, %U A348150 111111111111114,1111111111111122,11111111111111112,111111111111111132,1111111111111111119,11111111111111111121,111111111111111111117 %N A348150 a(n) is the smallest Niven (or Harshad) number with exactly n digits and not containing the digit 0. %C A348150 This sequence is inspired by a problem, proposed by Argentina during the 39th International Mathematical Olympiad in 1998 at Taipei, Taiwan, but not used for the competition. %C A348150 The problem asked for a proof that, for each positive integer n, there exists a n-digit number, not containing the digit 0 and that is divisible by the sum of its digits (see links: Diophante in French and Kalva in English). %C A348150 This sequence lists the smallest such n-digit integer. %H A348150 Michael S. Branicky, <a href="/A348150/b348150.txt">Table of n, a(n) for n = 1..1000</a> %H A348150 Diophante, <a href="http://www.diophante.fr/problemes-par-themes/arithmetique-et-algebre/a1-pot-pourri/3455-a1960-bon-souvenir-de-buenos-aires">Bon souvenir de Buenos-Aires</a>. %H A348150 Kalva, <a href="https://prase.cz/kalva/short/sh98.html">39th IMO 1998 shortlisted problems, problem N7</a>. %H A348150 <a href="/index/O#Olympiads">Index to sequences related to Olympiads</a>. %F A348150 a(n) = A002275(n) = R_n iff n is in A014950. %e A348150 111114 has 6 digits, does not contain 0 and is divisible by 1+1+1+1+1+4 = 9 (111114 = 9*12346), while 111111, 111112, 111113 are not respectively divisible by sum of their digits: 6, 7, 8; hence, a(6) = 111114. %t A348150 hQ[n_] := ! MemberQ[(d = IntegerDigits[n]), 0] && Divisible[n, Plus @@ d]; a[n_] := Module[{k = (10^n - 1)/9}, While[! hQ[k], k++]; k]; Array[a, 30] (* _Amiram Eldar_, Oct 03 2021 *) %o A348150 (PARI) a(n) = for(k=(10^n-1)/9, 10^n-1, if (vecmin(digits(k)) && !(k % sumdigits(k)), return (k))); \\ _Michel Marcus_, Oct 03 2021 %o A348150 (Python) %o A348150 def niven(n): %o A348150 s = str(n) %o A348150 return '0' not in s and n%sum(map(int, s)) == 0 %o A348150 def a(n): %o A348150 k = int("1"*n) %o A348150 while not niven(k): k += 1 %o A348150 return k %o A348150 print([a(n) for n in range(1, 22)]) # _Michael S. Branicky_, Oct 09 2021 %Y A348150 Cf. A002275, A005349, A217973. %K A348150 nonn,base %O A348150 1,2 %A A348150 _Bernard Schott_, Oct 03 2021 %E A348150 More terms from _Amiram Eldar_, Oct 03 2021