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.

Original entry on oeis.org

6, 10, 106, 1003, 10001, 100001, 1000001, 10000001, 100000001, 1000000006, 10000000003, 100000000007, 1000000000007, 10000000000015, 100000000000013, 1000000000000003, 10000000000000003, 100000000000000015, 1000000000000000007, 10000000000000000001
Offset: 1

Views

Author

Jaroslav Krizek, Nov 27 2010

Keywords

Comments

a(n) = the smallest n-digit number of the form p^3 or p^1*q^1, (p, q = distinct primes).

Crossrefs

Subsequence of A030513.
Cf. A182648 (largest n-digit numbers with exactly 4 divisors).

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.