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 A348316 #23 Mar 31 2023 08:15:04 %S A348316 9,84,999,9963,99972,999984,9999966,99999966,999999999,9999999828, %T A348316 99999999898,999999999853,9999999999936,99999999999783, %U A348316 999999999999984,9999999999999858,99999999999999939,999999999999999831,9999999999999999951,99999999999999999922,999999999999999999687 %N A348316 a(n) is the largest Niven (or Harshad) number with exactly n digits and not containing the digit 0. %C A348316 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 A348316 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 A348316 This sequence lists the largest such n-digit integer. %H A348316 Michael S. Branicky, <a href="/A348316/b348316.txt">Table of n, a(n) for n = 1..1000</a> %H A348316 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 A348316 Kalva, <a href="https://prase.cz/kalva/short/sh98.html">39th IMO 1998 shortlisted problems, problem N7</a>. %H A348316 <a href="/index/O#Olympiads">Index to sequences related to Olympiads</a>. %F A348316 a(n) = A002283(n) = 10^n - 1 iff n is in A014950 (compare with A348150 formula). %e A348316 9963 has 4 digits, does not contain 0 and is divisible by 9+9+6+3 = 27 (9963 = 27*369), while there is no integer k with 9964 <= k <= 9999 that is divisible by sum of its digits, hence a(4) = 9963. %t A348316 hQ[n_] := ! MemberQ[(d = IntegerDigits[n]), 0] && Divisible[n, Plus @@ d]; a[n_] := Module[{k = 10^n}, While[! hQ[k], k--]; k]; Array[a, 20] (* _Amiram Eldar_, Oct 11 2021 *) %o A348316 (Python) %o A348316 def a(n): %o A348316 s, k = "9"*n, int("9"*n) %o A348316 while '0' in s or k%sum(map(int, s)): k -= 1; s = str(k) %o A348316 return k %o A348316 print([a(n) for n in range(1, 22)]) # _Michael S. Branicky_, Oct 11 2021 %Y A348316 Cf. A002283, A005349, A014950, A217973, A348150, A348317, A348318. %K A348316 nonn,base %O A348316 1,1 %A A348316 _Bernard Schott_, Oct 11 2021 %E A348316 More terms from _Amiram Eldar_, Oct 11 2021