A174322 a(n) is the smallest n-digit number with exactly 4 divisors.
6, 10, 106, 1003, 10001, 100001, 1000001, 10000001, 100000001, 1000000006, 10000000003, 100000000007, 1000000000007, 10000000000015, 100000000000013, 1000000000000003, 10000000000000003, 100000000000000015, 1000000000000000007, 10000000000000000001
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..70
Programs
-
Mathematica
Table[k=10^(n-1); While[DivisorSigma[0, k] != 4, k++]; k, {n, 10}]
-
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
Formula
A000005(a(n)) = 4.
Comments