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.

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

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

A247305 The smaller of two consecutive triangular numbers which are permutations of each other.

Original entry on oeis.org

404550, 2653056, 3643650, 5633046, 6413571, 10122750, 10656036, 13762881, 19841850, 26634051, 32800950, 47848653, 56769840, 71634465, 89184690, 103672800, 137108520, 317053971, 345069585, 392714325, 408508236, 440762895, 508948560, 598735710, 718830486, 825215625
Offset: 1

Views

Author

K. D. Bajpai, Sep 11 2014

Keywords

Comments

All the terms in sequence are congruent to 0 mod 9.
It appears that the digital root (repeated sum of digits) of the index +1 of a(n) in A000217 is 9 for each n>=1.o 0 mod 9. For example, 404550 = A000217(899), and 899+1 = 900 has digital root 9.

Examples

			a(1) = 404550 is in the sequence because {404550 and 405450} are a pair of consecutive triangular numbers having exactly the same digits.
a(2) = 2653056 is in the sequence because {2653056 and 2655360} are two consecutive triangular numbers having exactly the same digits.
		

Crossrefs

Programs

  • Mathematica
    A247305 = {}; a = {1}; b = {2}; Do[t1 = n*(n + 1)/2; t2 = (n - 1)*(n - 1 + 1)/2; b = Sort[IntegerDigits[t1]]; If[a == b, AppendTo[A247305, t2]]; a = b, {n, 2, 7*10^4}]; A247305
  • PARI
    lista(nn) = {for (n=1, nn, dt = vecsort(digits(t=n*(n+1)/2)); dnt = vecsort(digits((n+1)*(n+2)/2)); if (dt == dnt, print1(t, ", ")););} \\ Michel Marcus, Sep 13 2014

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