login
A174322
a(n) is the smallest n-digit number with exactly 4 divisors.
2
6, 10, 106, 1003, 10001, 100001, 1000001, 10000001, 100000001, 1000000006, 10000000003, 100000000007, 1000000000007, 10000000000015, 100000000000013, 1000000000000003, 10000000000000003, 100000000000000015, 1000000000000000007, 10000000000000000001
OFFSET
1,1
COMMENTS
a(n) = the smallest n-digit number of the form p^3 or p^1*q^1, (p, q = distinct primes).
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..70
FORMULA
A000005(a(n)) = 4.
MATHEMATICA
Table[k=10^(n-1); While[DivisorSigma[0, k] != 4, k++]; k, {n, 10}]
PROG
(Python)
from sympy import divisors
def a(n):
k = 10**(n-1)
while len(divisors(k)) != 4: k += 1
return k
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Jun 10 2021
(Python) # faster alternative for larger terms
from sympy import divisors
def a(n):
k = 10**(n-1) - 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, 22)]) # Michael S. Branicky, Jun 10 2021
CROSSREFS
Subsequence of A030513.
Cf. A182648 (largest n-digit numbers with exactly 4 divisors).
Sequence in context: A348650 A201921 A117310 * A359332 A352132 A124902
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Nov 27 2010
STATUS
approved