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 A198376 #14 Jan 21 2021 11:38:27 %S A198376 1,21,311,4111,51111,611111,7111111,81111111,911111111,5211111111,0, %T A198376 621111111111,0,72111111111111,531111111111111,8211111111111111,0, %U A198376 921111111111111111,0,54111111111111111111,731111111111111111111,0,0,831111111111111111111111 %N A198376 Largest n-digit number whose product of digits is n or 0 if no such number exists. %H A198376 Michael S. Branicky, <a href="/A198376/b198376.txt">Table of n, a(n) for n = 1..1000</a> %F A198376 a(A068191(n)) = 0 for n >=1. %F A198376 a(n) <> 0 iff n in { A002473 }. - _Michael S. Branicky_, Jan 21 2021 %e A198376 113, 131, and 311 are the 3-digit numbers whose product of digits is 3; 311 is the largest. %t A198376 Table[If[FactorInteger[n][[-1, 1]] > 9, 0, i = (10^n - 1)/9; While[i < 10^n && Times @@ (d = IntegerDigits[i]) != n, i++]; If[i == 10^n, 0, FromDigits[Reverse[d]]]], {n, 30}] (* _T. D. Noe_, Oct 24 2011 *) %o A198376 (Python) %o A198376 def A198376(n): %o A198376 ncopy, p, an = n, 1, "" %o A198376 for d in range(9, 1, -1): %o A198376 while ncopy%d == 0: ncopy//=d; p *= d; an += str(d) %o A198376 if p == n and len(an) <= n: return int(an+'1'*(n-len(an))) %o A198376 return 0 %o A198376 print([A198376(n) for n in range(1, 25)]) # _Michael S. Branicky_, Jan 21 2021 %Y A198376 Cf. A198375 (smallest), A002473, A068191. %K A198376 nonn,base %O A198376 1,2 %A A198376 _Jaroslav Krizek_, Oct 23 2011