cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A174322 a(n) is the smallest n-digit number with exactly 4 divisors.

This page as a plain text file.
%I A174322 #21 Jun 11 2021 05:39:33
%S A174322 6,10,106,1003,10001,100001,1000001,10000001,100000001,1000000006,
%T A174322 10000000003,100000000007,1000000000007,10000000000015,
%U A174322 100000000000013,1000000000000003,10000000000000003,100000000000000015,1000000000000000007,10000000000000000001
%N A174322 a(n) is the smallest n-digit number with exactly 4 divisors.
%C A174322 a(n) = the smallest n-digit number of the form p^3 or p^1*q^1, (p, q = distinct primes).
%H A174322 Michael S. Branicky, <a href="/A174322/b174322.txt">Table of n, a(n) for n = 1..70</a>
%F A174322 A000005(a(n)) = 4.
%t A174322 Table[k=10^(n-1); While[DivisorSigma[0, k] != 4, k++]; k, {n, 10}]
%o A174322 (Python)
%o A174322 from sympy import divisors
%o A174322 def a(n):
%o A174322     k = 10**(n-1)
%o A174322     while len(divisors(k)) != 4: k += 1
%o A174322     return k
%o A174322 print([a(n) for n in range(1, 21)]) # _Michael S. Branicky_, Jun 10 2021
%o A174322 (Python) # faster alternative for larger terms
%o A174322 from sympy import divisors
%o A174322 def a(n):
%o A174322     k = 10**(n-1) - 1
%o A174322     divs = -1
%o A174322     while divs != 4:
%o A174322       k += 1
%o A174322       divs = 0
%o A174322       for d in divisors(k, generator=True):
%o A174322         divs += 1
%o A174322         if divs > 4: break
%o A174322     return k
%o A174322 print([a(n) for n in range(1, 22)]) # _Michael S. Branicky_, Jun 10 2021
%Y A174322 Subsequence of A030513.
%Y A174322 Cf. A182648 (largest n-digit numbers with exactly 4 divisors).
%K A174322 nonn,base
%O A174322 1,1
%A A174322 _Jaroslav Krizek_, Nov 27 2010