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.

Showing 1-5 of 5 results.

A007809 Smallest prime with n distinct digits.

Original entry on oeis.org

2, 13, 103, 1039, 10243, 102359, 1023467, 10234589, 102345689
Offset: 1

Views

Author

N.B. Backhouse (sx52(AT)liverpool.ac.uk)

Keywords

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 1039, p.126, Ellipses, Paris 2008. [From Lekraj Beedassy, Oct 12 2008]

Crossrefs

Programs

  • Mathematica
    Table[Module[{k=NextPrime[10^n]},While[Max[DigitCount[k]]>1,k=NextPrime[k]];k],{n,0,8}] (* Harvey P. Dale, May 27 2025 *)
  • PARI
    A007809(n,p=A038378(n))={until(isprime(p),while(#Set(digits(p++))M. F. Hasler, May 04 2017
    
  • Python
    from sympy import nextprime
    def a(n):
      p = nextprime(10**(n-1))
      while len(set(str(p))) < n: p = nextprime(p)
      return p
    for n in range(1, 10):
      print(a(n), end=", ") # Michael S. Branicky, Feb 13 2021

Extensions

Corrected by Jud McCranie, Jan 03 2001

A007810 Largest prime with n distinct decimal digits.

Original entry on oeis.org

7, 97, 983, 9871, 98731, 987631, 9876413, 98765431, 987654103
Offset: 1

Views

Author

N. B. Backhouse (sx52(AT)liverpool.ac.uk)

Keywords

Comments

Differs from A071361 from a(7) on. - M. F. Hasler, May 03 2017

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 9871, p.194, Ellipses, Paris 2008.

Crossrefs

Programs

  • Mathematica
    Table[Module[{k=NextPrime[10^n-1,-1]},While[Max[DigitCount[k]]>1, k = NextPrime[ k,-1]];k],{n,9}] (* Harvey P. Dale, Sep 16 2019 *)
  • PARI
    A007810(n,p=sum(k=1,n,(9+k-n)*10^k)/10)={until(#Set(digits(p--))==n&&isprime(p),);p} \\ M. F. Hasler, May 03 2017

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

A071360 Smallest n-digit prime with strictly decreasing digits.

Original entry on oeis.org

2, 31, 421, 5431, 75431, 764321, 8764321, 97654321
Offset: 1

Views

Author

Rick L. Shepherd, May 21 2002

Keywords

Crossrefs

A071361 Largest n-digit prime with strictly decreasing digits.

Original entry on oeis.org

7, 97, 983, 9871, 98731, 987631, 9875321, 98765431
Offset: 1

Views

Author

Rick L. Shepherd, May 21 2002

Keywords

Comments

Differs from A007810 (largest prime with n distinct digits) from a(7) on. [Edited by M. F. Hasler, May 03 2017]

Crossrefs

Programs

  • PARI
    A071361(n,u=-vectorv(n,i,10^(n-i)))=forvec(d=vector(n,i,-[9,1]),isprime(d*u)&&return(d*u),2) \\ M. F. Hasler, May 03 2017
Showing 1-5 of 5 results.