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

A052998 A052902 / 18.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1, 0, 0, 1, 5, 4, 2, 5, 1, 8, 1, 2, 3, 15, 0, 23, 25, 25, 2, 1, 35, 40, 3, 1, 40, 0, 0, 0, 0, 0, 3, 10, 15, 0, 0, 0, 8, 25, 30, 30, 3, 13, 10, 1, 8, 1, 2, 22, 5, 0, 13, 17, 2, 1, 0, 25, 1, 20, 0, 4, 10, 0, 0, 5, 0, 0, 5, 10, 10, 10, 26, 0, 4, 0
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2000

Keywords

Crossrefs

Extensions

More terms from Asher Auel, May 12 2000

A055387 2, 3, 5, 7, together with primes such that there is a nontrivial rearrangement of the digits which is a prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 31, 37, 71, 73, 79, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 239, 241, 251, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 359, 367, 373, 379, 389, 397, 401, 419, 421
Offset: 1

Views

Author

Asher Auel, May 05 2000

Keywords

Comments

Union of {2, 3, 5, 7} and A225035.

Crossrefs

Extensions

Edited by N. J. A. Sloane, Jan 22 2023

A225035 Primes such that there is a nontrivial rearrangement of the digits which is a prime.

Original entry on oeis.org

13, 17, 31, 37, 71, 73, 79, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 239, 241, 251, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 359, 367, 373, 379, 389, 397, 401, 419, 421
Offset: 1

Views

Author

Jayanta Basu, Apr 24 2013

Keywords

Comments

The new prime is necessarily different from the original prime (so 11, for example) is not a term. - N. J. A. Sloane, Jan 22 2023
Permutations producing leading zeros are allowed: thus 101 is in the sequence because a nontrivial permutation of its digits is 011. - Robert Israel, Aug 13 2019
It seems reasonable to expect that the proportion of n-digit primes that are in this sequence approaches 1 as n increases. - Peter Munn, Sep 13 2022

Examples

			13 is a term since a nontrivial permutation of its digits yields 31, which is also a prime.
		

References

  • H.-E. Richert, On permutation prime numbers, Norsk. Mat. Tidsskr. 33 (1951), p. 50-53.
  • Joe Roberts, Lure of the Integers, Math. Assoc. of Amer., 1992, p. 293.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Second Edition, Cambridge University Press, p. 121.

Crossrefs

See A055387, A359136-A359139 for other versions.

Programs

  • Maple
    dmax:=3: # for all terms of up to dmax digits
    Res:= {}:
    p:= 1:
    do
      p:= nextprime(p);
      if p > 10^dmax then break fi;
      L:= sort(convert(p,base,10),`>`);
      m:= add(L[i]*10^(i-1),i=1..nops(L));
      if assigned(A[m]) then
        if ilog10(A[m])=ilog10(p) then
          Res:= Res union {A[m], p}
        else Res:= Res union {p}
        fi
      else A[m]:= p
      fi
    od:
    sort(convert(Res,list)); # Robert Israel, Aug 13 2019
  • Mathematica
    t={}; Do[p = Prime[n]; list1 = Permutations[IntegerDigits[p]]; If[Length[ Select[Table[FromDigits[n], {n,list1}], PrimeQ]] > 1, AppendTo[t,p]], {n,84}]; t
  • PARI
    is(p) = if(isprime(p), my(d=vecsort(digits(p))); d==vector(#d,x,1)&&return(1); forperm(d, e, my(c = fromdigits(Vec(e))); p!=c && isprime(c) && return(1))); \\ Ruud H.G. van Tol, Jan 22 2023
  • Python
    from sympy import isprime
    from itertools import permutations
    def ok(n):
        if not isprime(n): return False
        perms = (int("".join(p)) for p in permutations(str(n)))
        return any(isprime(t) for t in perms if t != n)
    print([k for k in range(500) if ok(k)]) # Michael S. Branicky, Sep 14 2022
    

Extensions

Edited by N. J. A. Sloane, Jan 22 2023

A052495 Take n-th prime p, let P = all primes having same digits; a(n) = q-p where q is smallest prime in P >p if q exists; otherwise a(n) = p-r where r is largest prime in P

Original entry on oeis.org

0, 0, 0, 0, 0, 18, 54, 0, 0, 0, 18, 36, 0, 0, 0, 0, 0, 0, 0, 54, 36, 18, 0, 0, 18, 0, 0, 594, 0, 18, 144, 180, 36, 54, 270, 0, 414, 450, 450, 144, 18, 630, 720, 54, 522, 720, 0, 0, 0, 0, 0, 54, 180, 270, 0, 0, 0, 144, 450, 540, 540, 54, 0, 180, 18, 144, 18, 36, 396, 90, 0, 234
Offset: 1

Views

Author

Enoch Haga, Mar 16 2000

Keywords

Comments

The primes in P are required to have the same number of digits as p; thus internal 0's must remain internal 0's.

Examples

			a(41)=18 because the 41st prime is 179. The primes having these digits are 179, 197, 719 and 971. The distance from 179 to 197 = 18.
		

Crossrefs

A052999 Take n-th prime p, let P(p) = all primes that can be obtained by permuting the digits of p and possibly adding or omitting zeros; a(n) = |p-q| where q in P(p) is the closest to p but different from p (a(n)=0 if no such q exists).

Original entry on oeis.org

0, 0, 0, 0, 90, 18, 54, 90, 1980, 199980, 18, 36, 360, 3960, 3960, 450, 450, 540, 540, 36, 36, 18, 79999999999999999999999999999920, 720, 18, 90, 72, 36, 90, 18, 144, 18, 36, 54, 270, 900, 414, 450, 450, 36, 18, 630, 720, 54, 18, 720, 810, 1980, 1800, 1800, 2790, 54, 180, 270, 20250, 1800, 1800, 144
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2000

Keywords

Comments

Conjecture: a(n) > 0 for n > 4. - Sean A. Irvine, Nov 23 2021

Examples

			a(6)=18 since 6th prime is 13 and 31-13=18. a(9)=1980 because 9th prime is 23 and the smallest prime in P(6) different from 23 is 2003; 2003-23=1980.
a(23)=(8*10^31+3)-83 because 8*10^31+3 is closest prime distinct from 83 but in P(83). - _Sean A. Irvine_, Nov 23 2021
		

Crossrefs

Extensions

More terms from Asher Auel, May 12 2000
a(23) corrected by Sean A. Irvine, Nov 23 2021

A053544 A052999 / 18.

Original entry on oeis.org

0, 0, 0, 0, 5, 1, 3, 5, 110, 11110, 1, 2, 20, 220, 220, 25, 25, 30, 30, 2, 2, 1, 4444444444444444444444444444440, 40, 1, 5, 4, 2, 5, 1, 8, 1, 2, 3, 15, 50, 23, 25, 25, 2, 1, 35, 40, 3, 1, 40, 45, 110, 100, 100, 155, 3, 10, 15, 1125, 100, 100, 8, 25, 30, 30, 3, 13, 10, 1, 8, 1, 2, 22, 5, 275, 13, 17, 2, 1, 150, 25, 1, 20
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2000

Keywords

Crossrefs

Extensions

More terms from Asher Auel, May 12 2000
a(23) corrected by Sean A. Irvine, Dec 27 2021
Showing 1-6 of 6 results.