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

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

A066540 The first of two consecutive primes with equal digital sums.

Original entry on oeis.org

523, 1069, 1259, 1759, 1913, 2503, 3803, 4159, 4373, 4423, 4463, 4603, 4703, 4733, 5059, 5209, 6229, 6529, 6619, 7159, 7433, 7459, 8191, 9109, 9749, 9949, 10691, 10753, 12619, 12763, 12923, 13763, 14033, 14107, 14303, 14369, 15859, 15973, 16529, 16673, 16903, 17239
Offset: 1

Views

Author

Jason Earls, Jan 06 2002

Keywords

Comments

The difference between the two primes of the pair is a multiple of 18. - Antonio Roldán, Mar 13 2012

Examples

			a(1) = 523 because both it and the next prime, 541, have a digital sum of 10.
		

Crossrefs

Subsequence of A117838. A069567 is a subsequence.

Programs

  • Mathematica
    Prime[ Select[Range[2000], Apply[ Plus, IntegerDigits[ Prime[ # ]]] == Apply[ Plus, IntegerDigits[ Prime[ # + 1]]] & ]]
    Prime[#]&/@(SequencePosition[Total[IntegerDigits[#]]&/@Prime[Range[2000]],{x_,x_}][[;;,1]]) (* Harvey P. Dale, Mar 27 2025 *)
  • PARI
    upto(limit)={my(d=2, L=List()); forprime(p=3, nextprime(limit+1), my(s=sumdigits(p)); if(s==d, listput(L, precprime(p-1))); d=s); Vec(L) } \\ Harry J. Smith, Feb 22 2010
    
  • PARI
    is_A066540(p)={my(n=nextprime(p+1)); (n-p)%18==0 & isprime(p) & A007953(p)==A007953(n)}  \\ M. F. Hasler, Oct 13 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, sum(map(int, str(q)))
    print(list(islice(agen(), 42))) # Michael S. Branicky, Feb 19 2024

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

A069796 Prime(n) and prime(n+4) use the same digits.

Original entry on oeis.org

179, 1091, 1213, 1279, 3313, 3637, 4273, 6637, 8237, 8293, 8537, 9137, 9613, 10937, 12071, 14071, 15137, 19237, 19937, 20639, 21013, 22817, 22937, 24091, 24317, 26713, 28439, 29137, 29837, 31379, 32537, 33037, 33071, 35339, 36913, 37117
Offset: 1

Views

Author

Amarnath Murthy, Apr 09 2002

Keywords

Examples

			6637 is a member as the fourth next prime 6673 uses the same digits.
		

Crossrefs

Programs

  • Mathematica
    p = {0}; q = {1}; r = {1}; s = {1}; t = {1}; Do[ If[p == t, Print[ Prime[n - 5]]]; p = q; q = r; r = s; s = t; t = Sort[ IntegerDigits[ Prime[n]]], {n, 5 10^3}]
    Transpose[Select[Partition[Prime[Range[5000]],5,1],Sort[ IntegerDigits[ First[#]]] == Sort[IntegerDigits[Last[#]]]&]][[1]] (* Harvey P. Dale, Dec 26 2015 *)

Extensions

Edited, corrected and extended by Robert G. Wilson v, Apr 12 2002

A069793 Find smallest k such that prime(k) and prime(n+k) use the same digits; sequence gives prime(k).

Original entry on oeis.org

2, 1913, 113, 79, 179, 13, 337, 137, 1039, 37, 139, 619, 1031, 17, 1123, 349, 563, 3617, 1213, 1193, 839, 1129, 617, 1597, 2153, 1021, 173, 127, 571, 241, 3037, 3361, 131, 137, 113, 2141, 359, 1361, 1471, 1031, 1367, 587, 1013, 6337, 251, 2153, 149, 1049
Offset: 0

Views

Author

Amarnath Murthy, Apr 09 2002

Keywords

Examples

			a(1) = 1913 as the next prime 1931 uses the same digits. a(2) = 113 as the next to next prime 131 uses the same digits.
		

Crossrefs

Programs

  • Mathematica
    Do[a = {{{0}}}; a = Flatten[ Append[a, Table[{1}, {n}]], 1]; k = 1; While[ a[[1]] != a[[ -1]], a = Drop[a, 1]; k++; a = Append[a, Sort[ IntegerDigits[ Prime[k]]]]]; Print[ Prime[k - n]], {n, 1, 40}]

Extensions

Edited, corrected and extended by Robert G. Wilson v, Apr 12 2002

A069794 Prime(n) and prime(n+2) use the same digits.

Original entry on oeis.org

113, 313, 1579, 2113, 2879, 3779, 4813, 5179, 5237, 5279, 5879, 6113, 6379, 8713, 9091, 9479, 9679, 10313, 10513, 10613, 13313, 13913, 14779, 15013, 17579, 18713, 19213, 20879, 22013, 22091, 22679, 24179, 25037, 25913, 26479, 27179, 28579
Offset: 1

Views

Author

Amarnath Murthy, Apr 09 2002

Keywords

Comments

Prime(n) and prime(n+2) must use the same digits and the same number of repetitions of each digit. - Harvey P. Dale, Apr 26 2015

Examples

			113 is a member as the next to next prime 131 uses the same digits.
		

Crossrefs

Programs

  • Mathematica
    p = {0}; q = {1}; r = {1}; Do[ If[p == r, Print[ Prime[n - 3]]]; p = q; q = r; r = Sort[ IntegerDigits[ Prime[n]]], {n, 3 10^3}]
    sdQ[n_]:=Sort[IntegerDigits[n]]==Sort[IntegerDigits[NextPrime[n,2]]]; Select[Prime[Range[4000]],sdQ] (* Harvey P. Dale, Apr 26 2015 *)

Extensions

Edited, corrected and extended by Robert G. Wilson v, Apr 12 2002

A069795 Prime(n) and prime(n+3) use the same digits.

Original entry on oeis.org

79, 379, 613, 1013, 1979, 2713, 3613, 4817, 5413, 9413, 11113, 11579, 11813, 12437, 12479, 14713, 14813, 14879, 15313, 15937, 17239, 18617, 19037, 19979, 20071, 21379, 23279, 23813, 23917, 24337, 27091, 28279, 29437, 29537, 30091, 30781
Offset: 1

Views

Author

Amarnath Murthy, Apr 09 2002

Keywords

Examples

			79 is a member as the third next prime 97 uses the same digits.
		

Crossrefs

Programs

  • Mathematica
    p = {0}; q = {1}; r = {1}; s = {1}; Do[ If[p == s, Print[ Prime[n - 4]]]; p = q; q = r; r = s; s = Sort[ IntegerDigits[ Prime[n]]], {n, 3 10^3}]
    Prime[#]&/@Select[Range[3500],Sort[IntegerDigits[Prime[#]]]==Sort[ IntegerDigits[ Prime[ #+3]]]&] (* Harvey P. Dale, Mar 13 2019 *)

Extensions

Edited, corrected and extended by Robert G. Wilson v, Apr 12 2002

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
Showing 1-10 of 25 results. Next