[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A339080
Smaller members of binary Ormiston prime pairs: two consecutive primes whose binary representations are anagrams of each other.
3
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,1
COMMENTS
Equivalently, the smaller of two consecutive primes with the same length of binary representation (A070939) and the same binary weight (A000120).
LINKS
Jens Kruse Andersen, Ormiston Tuples.
Andy Edwards, Ormiston Pairs, Australian Mathematics Teacher, Vol. 58, No. 2 (2002), pp. 12-13.
Giovanni Resta, Ormiston pairs.
Eric Weisstein's World of Mathematics, Rearrangement Prime Pair.
EXAMPLE
11 is a term since 11 and 13 are consecutive primes whose binary representations, 1011 and 1101, are anagrams of each other.
MATHEMATICA
Transpose[Select[Partition[Prime[Range[200]], 2, 1], Sort[IntegerDigits[First[#], 2]] == Sort[IntegerDigits[Last[#], 2]]&]][[1]] (* after Harvey P. Dale at A069567 *)
PROG
(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
CROSSREFS
Cf. A000120, A069567 (decimal analog), A070939, A072274.
Sequence in context: A139493 A275591 A250665 * A077345 A130282 A019356
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Nov 22 2020
STATUS
approved