A182648 a(n) is the largest n-digit number with exactly 4 divisors.
8, 95, 998, 9998, 99998, 999997, 9999998, 99999997, 999999991, 9999999997, 99999999997, 999999999997, 9999999999989, 99999999999997, 999999999999998, 9999999999999994, 99999999999999989, 999999999999999993, 9999999999999999991, 99999999999999999983
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..62
Programs
-
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 *)
-
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
Formula
A000005(a(n)) = 4.
Extensions
a(19) and beyond from Michael S. Branicky, Jun 10 2021
Comments