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.

A069567 Smaller of two consecutive primes which are anagrams of each other.

Original entry on oeis.org

1913, 18379, 19013, 25013, 34613, 35617, 35879, 36979, 37379, 37813, 40013, 40213, 40639, 45613, 48091, 49279, 51613, 55313, 56179, 56713, 58613, 63079, 63179, 64091, 65479, 66413, 74779, 75913, 76213, 76579, 76679, 85313, 88379, 90379, 90679, 93113, 94379, 96079
Offset: 1

Views

Author

Amarnath Murthy, Mar 24 2002

Keywords

Comments

Smaller members of Ormiston prime pairs.
Given the n-th prime, it is occasionally possible to form the (n+1)th prime using the same digits in a different order. Such a pair is called an Ormiston pair.
Ormiston pairs occur rarely but randomly. It is thought that there are infinitely many but this has not been proved. They always differ by a multiple of 18. Ormiston triples also exist - see A075093.
"Anagram" means that both primes must not only use the same digits but must use each digit the same number of times. [From Harvey P. Dale, Mar 06 2012]
Dickson's conjecture would imply that the sequence is infinite, e.g. that there are infinitely many k for which 1913+3972900*k and 1931+3972900*k form an Ormiston pair. - Robert Israel, Feb 23 2017

Examples

			1913 and 1931 are two successive primes.
Although 179 and 197 are composed of the same digits, they do not form an Ormiston pair as several other primes intervene (i.e. 181, 191, 193).
		

References

  • Andy Edwards, Ormiston Pairs, Australian Mathematics Teacher, Vol. 58, No. 2 (2002), pp. 12-13.

Crossrefs

Programs

  • Haskell
    import Data.List (sort)
    a069567 n = a069567_list !! (n-1)
    a069567_list = f a000040_list where
       f (p:ps@(p':_)) = if sort (show p) == sort (show p')
                         then p : f ps else f ps
    -- Reinhard Zumkeller, Apr 03 2015
    
  • Maple
    N:= 10^6: # to get all terms <= N
    R:= NULL: p:= 3: q:= 5:
    while p <= N do
      p:= q;
      q:= nextprime(q);
      if q-p mod 18 = 0 and sort(convert(p,base,10)) = sort(convert(q,base,10)) then
        R:= R, p
      fi
    od:
    R; # Robert Israel, Feb 23 2017
  • Mathematica
    Prime[ Select[ Range[10^4], Sort[ IntegerDigits[ Prime[ # ]]] == Sort[ IntegerDigits[ Prime[ # + 1]]] & ]]
    a = {1}; b = {2}; Do[b = Sort[ IntegerDigits[ Prime[n]]]; If[a == b, Print[ Prime[n - 1], ", ", Prime[n]]]; a = b, {n, 1, 10^4}]
    Transpose[Select[Partition[Prime[Range[8600]],2,1],Sort[IntegerDigits[ First[#]]] == Sort[ IntegerDigits[Last[#]]]&]][[1]] (* Harvey P. Dale, Mar 06 2012 *)
  • PARI
    is(n)=isprime(n)&&vecsort(Vec(Str(n)))==vecsort(Vec(Str(nextprime(n+1)))) \\ Charles R Greathouse IV, Aug 09 2011
    
  • PARI
    p=2;forprime(q=3,1e5,if((q-p)%18==0&&vecsort(Vec(Str(p)))==vecsort(Vec(Str(q))),print1(p", "));p=q) \\ Charles R Greathouse IV, Aug 09 2011, minor edits by M. F. Hasler, Oct 11 2012
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        p, hp, q, hq = 2, "2", 3, "3"
        while True:
            if hp == hq: yield p
            p, q = q, nextprime(q)
            hp, hq = hq, "".join(sorted(str(q)))
    print(list(islice(agen(), 38))) # Michael S. Branicky, Feb 19 2024

Extensions

Comments and references from Andy Edwards (AndynGen(AT)aol.com), Jul 09 2002
Edited by Robert G. Wilson v, Jul 15 2002 and Aug 29 2002
Minor edits by Ray Chandler, Jul 16 2009

A072274 List of Ormiston prime pairs.

Original entry on oeis.org

1913, 1931, 18379, 18397, 19013, 19031, 25013, 25031, 34613, 34631, 35617, 35671, 35879, 35897, 36979, 36997, 37379, 37397, 37813, 37831, 40013, 40031, 40213, 40231, 40639, 40693, 45613, 45631, 48091, 48109, 49279, 49297, 51613, 51631, 55313, 55331, 56179, 56197
Offset: 1

Views

Author

Andy Edwards (AndynGen(AT)aol.com), Jul 09 2002

Keywords

Comments

Given the n-th prime, it is occasionally possible to form the (n+1)th prime using the same digits in a different order. Such a pair is an Ormiston Pair.
Ormiston Pairs occur rarely but randomly. It is thought that there are infinitely many but this has not been proved. They always differ by a multiple of 18. Ormiston Triples may exist but must be very large.
The smallest Ormiston triple is (11117123, 11117213, 11117321), the smallest Ormiston quadruple is (6607882123, 6607882213, 6607882231, 6607882321); see Andersen link. - Klaus Brockhaus, Jul 22 2009
The current wording of the definition suggests that the second member of Ormiston prime triples (cf. A075093) is repeated. Indeed, such a triple (p,q,r) corresponds to two pairs (a(2k-1)=p,a(2k)=q) and (a(2k+1)=q,a(2k+2)=r). (If they were listed as ...,p,q,r,..., then the sequence would still contain both pairs as (non-disjoint) subsequences. But if that was the intended meaning, then one would prefer the title "Members of O. prime pairs" (or simply O. primes?). Under this assumption, a(n)=a(n+1) iff a(n-1)=A075093(k) (for some k) is the smallest member of an Ormiston prime triple (a(n-1), a(n)=a(n+1), a(n+2)). In particular this is the case for the first two elements of Ormiston quadruples, cf. A161160. - M. F. Hasler, Oct 11 2012
The term "Ormiston pair" was coined by Andy Edwards in 2002 after Ormiston College in Queensland, Australia. - Amiram Eldar, Nov 25 2020

Examples

			Although 179 and 197 are composed of the same digits, they do not form an Ormiston Pair as several other primes intervene (i.e. 181, 191, 193.)
		

Crossrefs

Cf. A069567.
Cf. A075093 (smallest member of Ormiston prime triple), A161160 (smallest member of Ormiston prime quadruple).

Programs

  • Magma
    &cat[ [ p, q ]: p in PrimesUpTo(52000) | (q-p) mod 18 eq 0 and a eq b where a is Sort(Intseq(p)) where b is Sort(Intseq(q)) where q is NextPrime(p) ]; // Klaus Brockhaus, Jul 22 2009
    
  • Mathematica
    a = {1}; b = {2}; Do[b = Sort[ IntegerDigits[ Prime[n]]]; If[a == b, Print[ Prime[n - 1], ", ", Prime[n]]]; a = b, {n, 1, 10^4}]
  • PARI
    is(n)=if(!isprime(n), return(0)); my(d=vecsort(digits(n))); vecsort(digits(precprime(n-1)))==d || vecsort(digits(nextprime(n+1)))==d \\ Charles R Greathouse IV, Mar 07 2016
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        p, hp, q, hq = 2, "2", 3, "3"
        while True:
            if hp == hq: yield from [p, q]
            p, q = q, nextprime(q)
            hp, hq = hq, "".join(sorted(str(q)))
    print(list(islice(agen(), 38))) # Michael S. Branicky, Feb 19 2024

Formula

a(2k-1)=A069567(k); a(2k)=nextprime(a(2k-1)+1). - M. F. Hasler, Oct 13 2012

Extensions

Edited and corrected by Robert G. Wilson v, Jul 15 2002

A075093 Smallest member of Ormiston prime triple.

Original entry on oeis.org

11117123, 12980783, 14964017, 32638213, 32964341, 33539783, 35868013, 44058013, 46103237, 48015013, 50324237, 52402783, 58005239, 60601237, 61395239, 74699789, 76012879, 78163123, 80905879, 81966341, 82324237
Offset: 1

Views

Author

Robert G. Wilson v, Aug 31 2002

Keywords

Comments

A subsequence of A069567 which is in turn a subsequence of A072274. More precisely, this A075093 lists exactly the terms which precede repeated elements in A072274, since an Ormiston triple (p,q,r), i.e., three consecutive primes whose decimal representations are anagrams of each other, corresponds to two pairs (p,q) and (q,r), so that p=a(n) implies p=A072274(2k-1)=A069567(k) for some k, and q=A072274(2k)=A072274(2k+1)=A069567(k+1) and r=A072274(2k+2). - M. F. Hasler, Oct 11 2012

Examples

			The first Ormiston triples are 11117123, 11117213 and 11117321.
		

Crossrefs

Cf. A069567 - smaller member of an Ormiston prime pair.
Cf. A072274, A161160, A066540. - M. F. Hasler, Oct 11 2012

Programs

  • Haskell
    a075093 n = a075093_list !! (n-1)
    a075093_list = f a000040_list where
       f (p:ps@(q:r:_)) =
         if sort (show p) == sort (show q) && sort (show q) == sort (show r)
            then p : f ps else f ps
    -- Reinhard Zumkeller, Mar 09 2012
    
  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = 0; b = 1; Do[c = NextPrim[b]; If[ Sort[ IntegerDigits[a]] == Sort[ IntegerDigits[b]] == Sort[ IntegerDigits[c]], Print[a]]; a = b; b = c, {n, 1, 10^7}]
    op3Q[{a_,b_,c_}]:=Sort[IntegerDigits[a]]==Sort[IntegerDigits[b]] == Sort[ IntegerDigits[ c]]; Transpose[Select[Partition[Prime[ Range[ 5000000]],3,1], op3Q]][[1]] (* Harvey P. Dale, Jun 16 2014 *)
  • PARI
    is_A075093(n)={isprime(n) & vecsort(Vec(Str(n)))==vecsort(Vec(Str(n=nextprime(n+1)))) & vecsort(Vec(Str(n)))==vecsort(Vec(Str(nextprime(n+1))))} \\ M. F. Hasler, Oct 11 2012
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def hash(n): return "".join(sorted(str(n)))
    def agen(start=2): # generator of terms
        p = nextprime(start-1); q=nextprime(p); r=nextprime(q)
        hp, hq, hr = list(map(hash, [p, q, r]))
        while True:
            if hp == hq == hr: yield p
            p, q, r = q, r, nextprime(r)
            hp, hq, hr = hq, hr, hash(r)
    print(list(islice(agen(), 3))) # Michael S. Branicky, Feb 19 2024

A217372 Initial prime in the first Ormiston n-tuple.

Original entry on oeis.org

2, 1913, 11117123, 6607882123, 20847942560791
Offset: 1

Views

Author

Jens Kruse Andersen, Oct 20 2012

Keywords

Comments

An Ormiston n-tuple is n consecutive primes containing the same decimal digits in different order. a(5) found by Giovanni Resta. a(6) may be 166389896360719.

Examples

			(1913, 1931) is the first case of two consecutive primes with the same digits. The first 3-, 4- and 5-tuples are: (11117123, 11117213, 11117321), (6607882123, 6607882213, 6607882231, 6607882321), (20847942560791, 20847942560917, 20847942560971, 20847942561079, 20847942561097).
		

Crossrefs

Cf. A069567 (Ormiston pairs), A075093 (triples), A161160 (quadruples), A217797 (5-tuples)

A217797 Smallest member of Ormiston prime 5-tuple.

Original entry on oeis.org

20847942560791, 21815124622913, 35581541330719, 40546521517819, 47950363950791, 54808830290791, 65923105730719, 84573572180719, 85950417240719
Offset: 1

Views

Author

Giovanni Resta, Oct 12 2012

Keywords

Comments

Searched up to 10^14.
On 11 October 2012 Jens Kruse Andersen found a 6-tuple starting at 166389896360719, which is likely to be the smallest.

Examples

			a(1) is in the sequence since (20847942560791, 20847942560917, 20847942560971, 20847942561079, 20847942561097) are 5 consecutive primes whose decimal representations contain exactly the same digits.
		

Crossrefs

Cf. A072274 (Ormiston pairs), A075093 (Ormiston triples), A161160 (Ormiston quadruples).
Showing 1-5 of 5 results.