A339080 Smaller members of binary Ormiston prime pairs: two consecutive primes whose binary representations are anagrams of each other.
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
Examples
11 is a term since 11 and 13 are consecutive primes whose binary representations, 1011 and 1101, are anagrams of each other.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
- 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.
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
Comments