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.

A103545 Largest n-digit zeroless prime with nonprime digits.

Original entry on oeis.org

89, 991, 9949, 99991, 999961, 9999991, 99999989, 999999491, 9999999881, 99999999689, 999999999989, 9999999999161, 99999999999481, 999999999999989, 9999999999999641, 99999999999999961, 999999999999999989, 9999999999999999961, 99999999999999999989
Offset: 2

Views

Author

Ray G. Opao, Mar 22 2005

Keywords

Crossrefs

Cf. A103544.

Programs

  • Mathematica
    PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; f[n_] := Block[{pp = PrevPrim[ 10^n]}, While[ Union[ Join[{1, 4, 6, 8, 9}, IntegerDigits[pp]]] != {1, 4, 6, 8, 9}, pp = PrevPrim[pp]]; pp]; Table[ f[n], {n, 2, 18}] (* Robert G. Wilson v, Mar 26 2005 *)
  • Python
    from sympy import isprime
    from itertools import product
    def a(n):
        for p in product("98641", repeat=n):
            t = int("".join(p))
            if isprime(t): return t
    print([a(n) for n in range(2, 22)]) # Michael S. Branicky, Aug 10 2022

Extensions

More terms from Jonathan Vos Post, Mar 23 2005
a(7) to a(12) from Jonathan Vos Post, Mar 23 2005
a(13) to a(18) from Robert G. Wilson v, Mar 26 2005
a(19) and beyond from Michael S. Branicky, Aug 10 2022