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.

A050288 Pandigital primes.

Original entry on oeis.org

10123457689, 10123465789, 10123465897, 10123485679, 10123485769, 10123496857, 10123547869, 10123548679, 10123568947, 10123578649, 10123586947, 10123598467, 10123654789, 10123684759, 10123685749, 10123694857, 10123746859, 10123784569, 10123846597, 10123849657, 10123854679
Offset: 1

Views

Author

Keywords

Comments

Digits may appear multiple times; density n/log n (almost all primes are pandigital).
Note that actually a(n) is much larger than n*log(n) (see Formula section). Even for n = 10000, a(n) = 111571*n*log(n). - Zak Seidov, Jul 27 2014

Crossrefs

Cf. A050278.

Programs

  • Mathematica
    ta={{0}};Do[u=Union[IntegerDigits[n]]; If[Equal[u, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}]&&PrimeQ[n], ta=Append[ta, n]], {n, 10123456789, 20000000000}];ta (* Labos Elemer *)
  • PARI
    is(n)=isprime(n) && #vecsort(digits(n),,8)>9 \\ Charles R Greathouse IV, May 04 2013
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen(): # generator of terms
        for d in count(11):
            for f in "123456789":
                for m in product("0123456789", repeat=d-2):
                    for e in "1379":
                        t = f + "".join(m) + e
                        if len(set(t)) == 10 and isprime(it:=int(t)):
                            yield it
    print(list(islice(agen(), 20))) # Michael S. Branicky, Apr 09 2024

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Sep 14 2012
Intersection of A171102 and A000040. - Charles R Greathouse IV, May 04 2013