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-10 of 10 results.

A100369 Largest primes arising in A099756 which were built up from n distinct digits. This sequence differs from A007810 because more than one copy of each digit is permitted.

Original entry on oeis.org

11, 787, 22259, 70879, 607889, 4456789, 40456789, 304456879, 1123465789, 10123457689
Offset: 1

Views

Author

Labos Elemer, Nov 29 2004

Keywords

Comments

These primes are "largest among earliest primes" at fixed number of distinct digits chosen from A099756. Their position in A099756 are: {1,27,90,198,440,774,858,930,949,950}.

Examples

			n=3: a[3]=22259, built up from the 3-subset = {2,5,9} of decimal digits.
It appears in A099756 as the 90th term. It is by definition of A099756 is
the smallest prime that can be constructed from {2,5,9} and at the same time
it is the largest prime if running through all 3-subsets of decimal digits.
All terms includes at least 2 copies of some digit.
Differs from A007810[3]=983.
		

Crossrefs

Extensions

Edited by Charles R Greathouse IV, Aug 03 2010

A029743 Primes with distinct digits.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 103, 107, 109, 127, 137, 139, 149, 157, 163, 167, 173, 179, 193, 197, 239, 241, 251, 257, 263, 269, 271, 281, 283, 293, 307, 317, 347, 349, 359, 367, 379, 389
Offset: 1

Views

Author

Keywords

Comments

This sequence has 283086 terms, the last being 987654103 = A007810(9). - Jud McCranie
Intersection of A010784 and A000040; A178788(a(n)) * A010051(a(n)) = 1. [Reinhard Zumkeller, Sep 25 2011]

Crossrefs

Programs

  • Haskell
    a029743 n = a029743_list !! (n-1)
    a029743_list = filter ((== 1) . a010051) a010784_list
    -- Reinhard Zumkeller, Sep 25 2011
    
  • Mathematica
    t={};Do[p=Prime[n];If[Select[Transpose[Tally[IntegerDigits[p]]][[2]],#>1 &]=={},AppendTo[t,p]],{n,77}];t (* Jayanta Basu, May 04 2013 *)
    Select[Prime[Range[80]],Max[DigitCount[#]]<2&] (* Harvey P. Dale, Sep 13 2020 *)
  • Python
    from sympy import isprime
    from itertools import permutations as P
    dist = [p for d in range(1, 11) for p in P("0123456789", d) if p[0] != "0"]
    afull = [t for t in (int("".join(p)) for p in dist) if isprime(t)]
    print(afull[:100]) # Michael S. Branicky, Aug 04 2022

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

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

A071363 Largest n-digit prime with strictly increasing digits.

Original entry on oeis.org

7, 89, 569, 5689, 34679, 345689, 1456789, 23456789
Offset: 1

Views

Author

Rick L. Shepherd, May 21 2002

Keywords

Comments

Notice the terms with consecutive digits; search for 23456789 to find several related sequences including A006055, A052017 and A052077.

Examples

			a(1) = A052015(4), a(2) = A052015(15), a(3) = A052015(35), a(4) = A052015(61), ... In short, a(n) = A052015(b(n)) with b = (4, 15, 35, 61, 81, 94, 98, 100). - _M. F. Hasler_, May 03 2017
		

Crossrefs

Subsequence of A052015.

Programs

  • PARI
    A071363(n,u=vectorv(n,i,10^(n-i)))={forvec(d=vector(n,i,[1,9]),isprime(d*u)&&n=d*u,2);n} \\ M. F. Hasler, May 03 2017

A100370 Primes in A099756, sorted.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 41, 43, 47, 53, 59, 61, 67, 79, 83, 89, 101, 103, 107, 109, 127, 137, 139, 149, 151, 157, 163, 167, 179, 181, 211, 227, 239, 241, 251, 257, 263, 269, 281, 283, 307, 347, 349, 359, 367, 379, 389, 401, 409, 431, 449, 457, 461
Offset: 1

Views

Author

Labos Elemer, Nov 30 2004

Keywords

Comments

Inspired by A099756.

Examples

			Positions of "minimal terms" (see A007809) inside A099756 and here, in A100370, are {2,8,31,138,320,574,779,900,942,950} or {1,6,23,84,250,494,721,873,934,950} respectively.
This is because the orders of A099756 and A100370 are based on different criteria.
		

Crossrefs

Programs

  • Mathematica
    < 0 &][[-2]]*10^(Length[ss[[n]]] -  If[ Mod[ FromDigits@ ss[[n]], 3] == 0, 0, 1]) - 1]}, While[ Union@ IntegerDigits@ p != id, p = NextPrime@ p]; p]; f[3] = 3; Sort@ Array[f, 950]

A132129 Largest prime with distinct digits when written in base n.

Original entry on oeis.org

2, 19, 19, 577, 7417, 114229, 2053313, 42373937, 987654103, 25678048763, 736867805209, 23136292864193, 789018236128391, 29043982525257901, 1147797409030815779, 48471109094902530293, 2178347851919531491093, 103805969587115219167613, 5228356786703601108008083
Offset: 2

Views

Author

Rick L. Shepherd, Aug 11 2007

Keywords

Comments

a(10) = 987654103 = A007810(9). For n >= 3, a(n) < A062813(n), a multiple of n.
Contribution from R. J. Mathar, May 15 2010: (Start)
Supposed all digits are used and the digits at positions 0 to n-1 are d_0, d_1,... d_{n-1}, the candidates are d_0+d_1*n+d_2*n^2+....+d_{n-1}*n^(n-1).
These values are (n-1)*n/2 (mod n-1), and they cannot be prime if n is even, because this number is = 0 (mod n-1) then, showing that n-1 is a divisor.
In conclusion, if n is even, the entries have at most n-1 digits in base n. (End)
If n is odd then the candidate numbers considered in the previous comment are divisible by (n-1)/2. Hence, we conclude that for n>3, a(n) has at most n-1 digits in base n. Conjecture: for n>3, a(n) has exactly n-1 digits in base n. - Eric M. Schmidt, Oct 26 2014

Examples

			a(9) = 42373937 as the prime 42373937 (base 10) = 87654102 (base 9), the largest prime number with distinct digits when represented in base 9.
		

Crossrefs

Programs

  • Sage
    def a(n) :
        if n==2 : return 2
        if n==3 : return 19
        for P in Permutations(range(n-1,-1,-1), n-1) :
            N = sum(P[-1-i]*n^i for i in range(n-1))
            if is_prime(N) : return N
    # Eric M. Schmidt, Oct 26 2014

Extensions

Removed my claim of finiteness of the sequence. - R. J. Mathar, May 18 2010
a(11)-a(20) from Eric M. Schmidt, Oct 26 2014

A259146 Smallest prime with first n digits distinct.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Jun 19 2015

Keywords

Comments

The sequence is complete: n=1..10.

Crossrefs

Programs

  • Python
    from sympy import nextprime
    def a(n):
      p = nextprime(10**(n-1))
      while len(set(str(p)[:n])) < n: p = nextprime(p)
      return p
    for n in range(1, 11):
      print(a(n), end=", ") # Michael S. Branicky, Feb 13 2021

Formula

a(n) = A007809(n), n<=9. - R. J. Mathar, Jul 06 2015

A259152 a(n) = smallest n-digit prime with first 10 digits distinct.

Original entry on oeis.org

10234567897, 102345678907, 1023456789013, 10234567890077, 102345678900007, 1023456789000073, 10234567890000053, 102345678900000059, 1023456789000000049, 10234567890000000007
Offset: 11

Views

Author

Zak Seidov, Jun 19 2015

Keywords

Comments

There is no 10-digit prime with the first 10 digits distinct, hence offset=11.

Crossrefs

Programs

A158716 Largest prime with n distinct nonprime digits.

Original entry on oeis.org

89, 941, 9601, 98641, 980641
Offset: 2

Views

Author

Lekraj Beedassy, Mar 24 2009

Keywords

Crossrefs

Cf. A007810.

Programs

  • Mathematica
    a[n_]:=Module[{k=NextPrime[10^n-1,-1]}, While[!SubsetQ[{0,1,4,6,8,9}, IntegerDigits[k]] || CountDistinct[IntegerDigits[k]]Stefano Spezia, Aug 29 2025 *)
Showing 1-10 of 10 results.