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.

A073532 Number of n-digit primes with all digits distinct.

Original entry on oeis.org

4, 20, 97, 510, 2529, 10239, 33950, 90510, 145227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Zak Seidov, Aug 29 2002

Keywords

Comments

For any base b the number of distinct-digit primes is finite. For base 10, the maximal distinct-digit prime is 987654103; for any larger prime at least two digits coincide. The number of distinct-digit integers is also finite, see A073531.
No such primes exist with 10 or more distinct decimal digits, so a(n) = 0 for n >= 10. - Labos Elemer, Oct 25 2004; Robert G. Wilson v, Jul 25 2008

Examples

			a(3)=97 because there are 97 three-digit primes with distinct digits: 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, 397, 401, 409, 419, 421, 431, 439, 457, 461, 463, 467, 479, 487, 491, 503, 509, 521, 523, 541, 547, 563, 569, 571, 587, 593, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 673, 683, 691, 701, 709, 719, 739, 743, 751, 761, 769, 809, 821, 823, 827, 829, 839, 853, 857, 859, 863, 907, 937, 941, 947, 953, 967, 971, 983.
		

Crossrefs

Programs

  • Mathematica
    lst = {}; Do[p = Prime@ n; If[ Union[Length /@ Split@ Sort@ IntegerDigits@ p] == {1}, AppendTo[lst, p]], {n, PrimePi[10^9]}]; Table[ Length@ Select[lst, 10^n < # < 10^(n + 1) &], {n, 0, 9}] (* Robert G. Wilson v, Jul 25 2008 *)
  • Python
    from itertools import permutations
    from sympy import isprime, primerange
    def distinct_digs(n): s = str(n); return len(s) == len(set(s))
    def a(n):
      if n >= 10: return 0
      return sum(isprime(int("".join(p))) for p in permutations("0123456789", n) if p[0] != '0')
    print([a(n) for n in range(1, 31)]) # Michael S. Branicky, Apr 20 2021

Extensions

Edited by N. J. A. Sloane, Aug 14 2007
Entries checked by Robert G. Wilson v, Jul 25 2008

A098224 Number of primes <=10^n in which decimal digits are all distinct.

Original entry on oeis.org

4, 24, 121, 631, 3160, 13399, 47349, 137859, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086
Offset: 1

Views

Author

Labos Elemer, Oct 26 2004

Keywords

Comments

Partial sums of A073532. - Lekraj Beedassy, Aug 02 2008
No number with more than 10 digits can have all of its decimal digits distinct, and no number that uses all ten distinct decimal digits can be prime (because the sum of all ten decimal digits is 45 so any such number is divisible by 3). Therefore, every term in the sequence from and after a(9) is the same, i.e., 283086. - Harvey P. Dale, Dec 12 2010

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=Max[DigitCount[n]]==1
    Table[Length[Select[Prime[Range[PrimePi[10^i]]],okQ]],{i,9}] (* Harvey P. Dale, Dec 12 2010 *)
  • Python
    from sympy import sieve
    def distinct_digs(n): s = str(n); return len(s) == len(set(s))
    def aupton(terms):
      ps, alst = 0, []
      for n in range(1, terms+1):
        if n >= 10: alst.append(ps); continue
        ps += sum(distinct_digs(p) for p in sieve.primerange(10**(n-1), 10**n))
        alst.append(ps)
      return alst
    print(aupton(35)) # Michael S. Branicky, Apr 24 2021

Formula

a(n) = 283086 for n >= 9.

A098226 Number of primes <= 10^n which have repeated decimal digits.

Original entry on oeis.org

0, 1, 47, 598, 6432, 65099, 617230, 5623596, 50564448, 454769425, 4117771727, 37607628932, 346065253753, 3204941467716, 29844570139583, 279238340750839, 2623557157371147, 24739954287457774, 234057667276061521, 2220819602560635754, 21127269486018448842
Offset: 1

Views

Author

Labos Elemer, Oct 25 2004

Keywords

Crossrefs

Formula

For n>=10 a(n) = A006880(n) - 283086 because the total number of distinct-digit primes equals 283086. See A098224.

Extensions

a(13)-a(21) from Giovanni Resta, Oct 29 2019

A099629 Smallest and largest primes pairwise displayed with k digits from k=1,...,9 with distinct decimal digits.

Original entry on oeis.org

2, 7, 13, 97, 103, 983, 1039, 9871, 10243, 98731, 102359, 987631, 1023467, 9876413, 10234589, 98765431, 102345689, 987654103
Offset: 1

Views

Author

Labos Elemer, Oct 26 2004; corrected Oct 29 2004

Keywords

Crossrefs

A099630 Smallest and largest primes pairwise displayed with k digits from k=2,3,... with repeated decimal digits.

Original entry on oeis.org

11, 11, 101, 997, 1009, 9973, 10007, 99991, 100003, 999983, 1000003, 9999991, 10000019, 99999989, 100000007, 999999937, 1000000007, 9999999967, 10000000019, 99999999977, 100000000003, 999999999989, 1000000000039, 9999999999971, 10000000000037, 99999999999973
Offset: 1

Views

Author

Labos Elemer, Oct 26 2004

Keywords

Comments

Contrary to A099629, this sequence is evidently infinite. Essentially [for more than 2 digits] consists of pairs of {nextprime[10^j],prevprime[10^(j+1)]}.

Crossrefs

Programs

  • Mathematica
    Join[{11,11},Flatten[Table[{NextPrime[10^n],NextPrime[10^(n+1),-1]}, {n,2,20}]]] (* Harvey P. Dale, Jun 04 2018 *)

Extensions

Corrected and extended by Harvey P. Dale, Jun 04 2018
Showing 1-5 of 5 results.