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 13 results. Next

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

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

A161160 Smallest member of Ormiston prime quadruple.

Original entry on oeis.org

6607882123, 7768673789, 11550316123, 13978938739, 16819885123, 20316483739, 31542480917, 36739640911, 38132974739, 40224610913, 44453840917, 45078784789, 48421320917, 48789908137, 53623243789, 54120163789, 54936260123, 56168170789
Offset: 1

Views

Author

Ray Chandler, Jun 03 2009

Keywords

Comments

An Ormiston (or Rearrangement) prime quadruple is a sequence of 4 consecutive primes, which all have the same decimal digits in some different order. - M. F. Hasler, Oct 08 2012
The first Ormiston quintuple is (20847942560791, 20847942560917, 20847942560971, 20847942561079, 20847942561097). - Giovanni Resta, Oct 07 2012
A subsequence of A075093 and thus of A072274. - M. F. Hasler, Oct 11 2012

Examples

			The first Ormiston quadruple is (6607882123,6607882213,6607882231,6607882321).
		

Crossrefs

A163863 a(n) = smaller member p of first (i.e., smallest) Ormiston pair (p, q) with gap 18*n.

Original entry on oeis.org

1913, 98737, 35617, 1290719, 2030789, 11117213, 26742347, 109161617, 335440351, 92801029, 46006769, 3121826537, 5322398359, 7425894361, 6640450693, 43693080679, 53568812923, 72880315369, 271695323149, 40830835151, 38116957819, 241564332377, 351336577379, 551763092297, 923411678933
Offset: 1

Views

Author

Klaus Brockhaus and Ki Punches, Aug 05 2009

Keywords

Comments

An Ormiston pair (or rearrangement prime pair) is a pair of consecutive primes that use the same digits in a different order. The gap q - p of an Ormiston pair (p, q) is a multiple of 18.

Examples

			The smallest Ormiston pair with gap 18*3 is (35617, 35671), so a(3) = 35617.
		

Crossrefs

Programs

  • PARI
    {m=20; v=vector(m); p=1; while(p<10^10, q=nextprime(p+1); gap=q-p; if(gap%18==0&&v[j=gap\18]==0&&vecsort(Vec(Str(p)))==vecsort(Vec(Str(q))), v[j]=p; print(p, ",", q, ",", gap, ",")); p=q); print(); for(j=1, m, if(v[j]>0, print1(v[j], ","), break))}

Extensions

Definition clarified by Klaus Brockhaus and Ki Punches, Aug 08 2009
a(17)-a(19) and a(22) from Klaus Brockhaus and Ki Punches, Aug 13 2009
a(23)-a(25) from Klaus Brockhaus, Sep 07 2009

A163678 Smaller prime p in Ormiston pairs (p, q) with q - p = 18.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Aug 03 2009

Keywords

Comments

An Ormiston pair (or rearrangement prime pair) is a pair of consecutive primes that use the same digits in a different order.

Examples

			(19013, 19031) is an Ormiston pair with gap 18, so 19013 is in the sequence.
		

Crossrefs

Subsequence of A069567.

Programs

  • Magma
    [ p: p in PrimesUpTo(100000) | q-p eq 18 and a eq b where a is Sort(Intseq(p)) where b is Sort(Intseq(q)) where q is NextPrime(p) ];
  • Mathematica
    Transpose[Select[Select[Partition[Prime[Range[10000]], 2, 1], Last[#] - First[#] == 18 &], Sort[IntegerDigits[First[#]]] == Sort[IntegerDigits[Last[#]]] &]][[1]] (* G. C. Greubel, Aug 02 2017 *)

Extensions

Keyword base added by Klaus Brockhaus, Sep 18 2009

A339080 Smaller members of binary Ormiston prime pairs: two consecutive primes whose binary representations are anagrams of each other.

Original entry on oeis.org

11, 23, 37, 59, 83, 103, 107, 131, 139, 151, 167, 173, 179, 199, 227, 229, 263, 277, 347, 409, 419, 439, 487, 491, 503, 557, 563, 613, 647, 653, 659, 683, 719, 727, 757, 811, 823, 827, 839, 853, 911, 941, 947, 953, 967, 997, 1019, 1063, 1091, 1093, 1123, 1163
Offset: 1

Views

Author

Amiram Eldar, Nov 22 2020

Keywords

Comments

Equivalently, the smaller of two consecutive primes with the same length of binary representation (A070939) and the same binary weight (A000120).

Examples

			11 is a term since 11 and 13 are consecutive primes whose binary representations, 1011 and 1101, are anagrams of each other.
		

Crossrefs

Cf. A000120, A069567 (decimal analog), A070939, A072274.

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[200]], 2, 1], Sort[IntegerDigits[First[#],2]] == Sort[IntegerDigits[Last[#],2]]&]][[1]] (* after Harvey P. Dale at A069567 *)
  • Python
    from sympy import nextprime
    from itertools import islice
    def hash(n): return "".join(sorted(bin(n)[2:]))
    def agen(start=2): # generator of terms
        p = nextprime(start-1); q=nextprime(p)
        hp, hq = list(map(hash, [p, q]))
        while True:
            if hp == hq: yield p
            p, q = q, nextprime(q)
            hp, hq = hq, hash(q)
    print(list(islice(agen(), 52))) # Michael S. Branicky, Feb 19 2024

A162765 Least prime of two Ormiston pairs in same century.

Original entry on oeis.org

277513, 379513, 558913, 565937, 837737, 850613, 936713, 1085113, 1353137, 1360613, 1374413, 1491013, 1529513, 1533313, 1745813, 1833613, 1855013, 2111513, 2138813, 2153737, 2194613, 2557213, 2601913, 2847413, 3277513
Offset: 1

Views

Author

Ki Punches, Jul 13 2009

Keywords

Comments

Two consecutive primes that use the same digits (rearranged) are called an Ormiston pair (see A072274).
The first case of three Ormiston pairs in the same century is (65150713, 65150731), (65150737, 65150773), (65150779, 65150797). The definition is unclear in such cases. The linked table includes both 65150713 and 65150737. - Jens Kruse Andersen, Jul 22 2014

Examples

			277513 and 277531 is first, and 277579 and 277597 is the second Ormiston pair in the 2776th century.
		

References

  • Andy Edwards, Ormiston Pairs, AMT Magazine, Volume 58 Number 2, 2002, p.12-13.

Crossrefs

Cf. A072274.

Extensions

Edited and extended by Klaus Brockhaus, Jul 22 2009

A163679 Smaller prime p in Ormiston pairs (p, q) with q - p = 36.

Original entry on oeis.org

98737, 116293, 187237, 240437, 276781, 343337, 357437, 447137, 454637, 456293, 465337, 508037, 542837, 565937, 586237, 623071, 802037, 817237, 820837, 836071, 837737, 839837, 843137, 850637, 884537, 897781, 903037, 913337, 1032071
Offset: 1

Views

Author

Klaus Brockhaus, Aug 03 2009

Keywords

Comments

An Ormiston pair (or rearrangement prime pair) is a pair of consecutive primes that use the same digits in a different order.

Examples

			(187237, 187273) is an Ormiston pair with gap 36, so 187237 is in the sequence.
		

Crossrefs

Subsequence of A069567.

Programs

  • Magma
    [ p: p in PrimesUpTo(1050000) | q-p eq 36 and a eq b where a is Sort(Intseq(p)) where b is Sort(Intseq(q)) where q is NextPrime(p) ];
  • Mathematica
    Transpose[Select[Select[Partition[Prime[Range[8000]], 2, 1], Last[#] - First[#] == 36 &], Sort[IntegerDigits[First[#]]] == Sort[IntegerDigits[Last[#]]] &]][[1]] (* G. C. Greubel, Aug 02 2017 *)

Extensions

Keyword base added by Klaus Brockhaus, Sep 18 2009

A163680 Smaller prime p in Ormiston pairs (p, q) with q - p = 54.

Original entry on oeis.org

35617, 40639, 359783, 502339, 552917, 580417, 668417, 719839, 807017, 824339, 833117, 861239, 909917, 961339, 987739, 1078417, 1145539, 1168639, 1185017, 1196539, 1220839, 1313239, 1479617, 1497439, 1710439, 1710539, 1732139
Offset: 1

Views

Author

Klaus Brockhaus, Aug 03 2009

Keywords

Comments

An Ormiston pair (or rearrangement prime pair) is a pair of consecutive primes that use the same digits in a different order.

Examples

			(359783, 359837) is an Ormiston pair with gap 54, so 359783 is in the sequence.
		

Crossrefs

Subsequence of A069567.

Programs

  • Magma
    [ p: p in PrimesUpTo(1750000) | q-p eq 54 and a eq b where a is Sort(Intseq(p)) where b is Sort(Intseq(q)) where q is NextPrime(p) ];
  • Mathematica
    op54Q[{a_,b_}]:=Sort[IntegerDigits[a]]==Sort[IntegerDigits[b]] && b-a==54; Transpose[Select[Partition[Prime[Range[150000]],2,1],op54Q]][[1]] (* Harvey P. Dale, Jun 16 2014 *)

Extensions

Keyword base added by Klaus Brockhaus, Sep 18 2009

A163682 Smaller prime p in Ormiston pairs (p, q) with q - p = 90.

Original entry on oeis.org

2030789, 2542237, 3863017, 4508341, 7001123, 7583341, 8482459, 8547677, 8916239, 9194677, 9470017, 11117123, 11755673, 11999563, 13691563, 13898237, 15906127, 16047673, 16272343, 16299013, 16829563, 17437457, 17604347
Offset: 1

Views

Author

Klaus Brockhaus, Aug 03 2009

Keywords

Comments

An Ormiston pair (or rearrangement prime pair) is a pair of consecutive primes that use the same digits in a different order.

Examples

			(3863017, 3863107) is an Ormiston pair with gap 90, so 3863017 is in the sequence.
		

Crossrefs

Subsequence of A069567.

Programs

  • Magma
    [ p: p in PrimesUpTo(17700000) | q-p eq 90 and a eq b where a is Sort(Intseq(p)) where b is Sort(Intseq(q)) where q is NextPrime(p) ];
  • Mathematica
    Transpose[Select[Select[Partition[Prime[Range[70000]], 2, 1], Last[#] - First[#] == 90 &], Sort[IntegerDigits[First[#]]] == Sort[IntegerDigits[Last[#]]] &]][[1]] (* G. C. Greubel, Aug 02 2017 *)

Extensions

Keyword base added by Klaus Brockhaus, Sep 18 2009
Showing 1-10 of 13 results. Next