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.

A071362 Smallest n-digit prime with strictly increasing digits.

Original entry on oeis.org

2, 13, 127, 1237, 12347, 123457, 1234789, 12356789
Offset: 1

Views

Author

Rick L. Shepherd, May 21 2002

Keywords

Crossrefs

Programs

  • PARI
    A071362(n, u=vectorv(n, i, 10^(n-i)))=forvec(d=vector(n, i, [1, 9]), isprime(d*u)&&return(d*u), 2) \\ M. F. Hasler, May 04 2017
    
  • Python
    from sympy import nextprime
    def inc(n):
      s = str(n); return len(s)==1 or all(d>pd for pd, d in zip(s[:-1], s[1:]))
    def a(n):
      p = nextprime(10**(n-1))
      while not inc(p): p = nextprime(p)
      return p
    for n in range(1, 9):
      print(a(n), end=", ") # Michael S. Branicky, Feb 13 2021