login
A182648
a(n) is the largest n-digit number with exactly 4 divisors.
2
8, 95, 998, 9998, 99998, 999997, 9999998, 99999997, 999999991, 9999999997, 99999999997, 999999999997, 9999999999989, 99999999999997, 999999999999998, 9999999999999994, 99999999999999989, 999999999999999993, 9999999999999999991, 99999999999999999983
OFFSET
1,1
COMMENTS
a(n) is the largest n-digit number of the form p^3 or p^1*q^1, (p, q = distinct primes).
Large overlap with A098450 which considers p^2 and p*q with n digits. - R. J. Mathar, Apr 23 2024
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..62
FORMULA
A000005(a(n)) = 4.
MATHEMATICA
Table[k=10^n-1; While[DivisorSigma[0, k] != 4, k--]; k, {n, 10}]
lnd4[n_]:=Module[{k=10^n-1}, While[DivisorSigma[0, k]!=4, k--]; k]; Array[lnd4, 20] (* Harvey P. Dale, Aug 20 2024 *)
PROG
(Python)
from sympy import divisors
def a(n):
k = 10**n - 1
divs = -1
while divs != 4:
k -= 1
divs = 0
for d in divisors(k, generator=True):
divs += 1
if divs > 4: break
return k
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Jun 10 2021
CROSSREFS
Subsequence of A030513.
Sequence in context: A298659 A299611 A099298 * A003775 A262737 A299747
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Nov 27 2010
EXTENSIONS
a(19) and beyond from Michael S. Branicky, Jun 10 2021
STATUS
approved