%I #18 May 24 2021 07:33:39
%S 7,19,23,43,71,101
%N Pri-most primes: primes p such that the majority of bits in the binary representation of p satisfy the following: complementing this bit produces a prime number.
%C Primes in A292348.
%C Conjecture: the sequence is finite.
%t Select[Prime@ Range[10^5], Function[n, Function[d, 2 Count[Array[FromDigits[#, 2] &@ MapAt[Mod[# + 1, 2] &, d, #] &, Length@ d], _?PrimeQ] > Length@ d]@ IntegerDigits[n, 2]]] (* _Michael De Vlieger_, Dec 08 2017 *)
%o (Python)
%o from sympy import isprime, primerange
%o for i in primerange(1, 1000):
%o delta = 0
%o bit = 1
%o while bit <= i:
%o if isprime(i^bit): delta += 1
%o else: delta -= 1
%o bit*=2
%o if delta > 0: print(str(i), end=',')
%Y Cf. A000040, A137985, A292348.
%K nonn,base,more
%O 1,1
%A _Alex Ratushnyak_, Dec 07 2017
|