%I #24 Aug 20 2024 13:37:42
%S 8,95,998,9998,99998,999997,9999998,99999997,999999991,9999999997,
%T 99999999997,999999999997,9999999999989,99999999999997,
%U 999999999999998,9999999999999994,99999999999999989,999999999999999993,9999999999999999991,99999999999999999983
%N a(n) is the largest n-digit number with exactly 4 divisors.
%C a(n) is the largest n-digit number of the form p^3 or p^1*q^1, (p, q = distinct primes).
%C Large overlap with A098450 which considers p^2 and p*q with n digits. - _R. J. Mathar_, Apr 23 2024
%H Michael S. Branicky, <a href="/A182648/b182648.txt">Table of n, a(n) for n = 1..62</a>
%F A000005(a(n)) = 4.
%t Table[k=10^n-1; While[DivisorSigma[0,k] != 4, k--]; k, {n,10}]
%t lnd4[n_]:=Module[{k=10^n-1},While[DivisorSigma[0,k]!=4,k--];k]; Array[lnd4,20] (* _Harvey P. Dale_, Aug 20 2024 *)
%o (Python)
%o from sympy import divisors
%o def a(n):
%o k = 10**n - 1
%o divs = -1
%o while divs != 4:
%o k -= 1
%o divs = 0
%o for d in divisors(k, generator=True):
%o divs += 1
%o if divs > 4: break
%o return k
%o print([a(n) for n in range(1, 21)]) # _Michael S. Branicky_, Jun 10 2021
%Y Subsequence of A030513.
%Y Cf. A174322, A098450.
%K nonn,base
%O 1,1
%A _Jaroslav Krizek_, Nov 27 2010
%E a(19) and beyond from _Michael S. Branicky_, Jun 10 2021