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
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Nov 27 2010
STATUS
approved