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
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).
- Andy Edwards, Ormiston Pairs, Australian Mathematics Teacher, Vol. 58, No. 2 (2002), pp. 12-13.
-
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
-
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
-
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 *)
-
is(n)=isprime(n)&&vecsort(Vec(Str(n)))==vecsort(Vec(Str(nextprime(n+1)))) \\ Charles R Greathouse IV, Aug 09 2011
-
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
-
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
Comments and references from Andy Edwards (AndynGen(AT)aol.com), Jul 09 2002
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
Andy Edwards (AndynGen(AT)aol.com), Jul 09 2002
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.)
Cf.
A075093 (smallest member of Ormiston prime triple),
A161160 (smallest member of Ormiston prime quadruple).
-
&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
-
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}]
-
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
-
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
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
The first Ormiston triples are 11117123, 11117213 and 11117321.
Cf.
A069567 - smaller member of an Ormiston prime pair.
-
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
-
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 *)
-
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
-
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
(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).
A217797
Smallest member of Ormiston prime 5-tuple.
Original entry on oeis.org
20847942560791, 21815124622913, 35581541330719, 40546521517819, 47950363950791, 54808830290791, 65923105730719, 84573572180719, 85950417240719
Offset: 1
a(1) is in the sequence since (20847942560791, 20847942560917, 20847942560971, 20847942561079, 20847942561097) are 5 consecutive primes whose decimal representations contain exactly the same digits.
Showing 1-5 of 5 results.
Comments