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.
%I A339268 #37 Feb 26 2023 09:27:18 %S A339268 11,549755813881,53,17,41,37,16349,89,977,197,193,181,173,937,929,149, %T A339268 137,389,1913,881,877,353,857,3917,317,821,3889,809,293,797,257,761, %U A339268 3821,65257,3797,3793,709,1721,3761,677,1048217,661,641,3709,3701,3697,601,577 %N A339268 The smallest prime that becomes 2 * prime(n), when all the bits in its binary expansion are inverted, or -1 if no such prime exists. %C A339268 Conjecture: a(n) > 0 for all n. %C A339268 a(6705), for prime(6705) = 67289, is either -1 or greater than (2^62500 - 1) * 262144 + 127565, which has 18820 digits. - _Michael S. Branicky_, Dec 05 2020 %H A339268 Michael S. Branicky, <a href="/A339268/b339268.txt">Table of n, a(n) for n = 1..6704</a> %e A339268 a(1) = 11, because 11 = 1011_2 -inv-> 0100_2 = 4 = 2 * 2. %e A339268 a(2) = 549755813881, because 549755813881 = 111111111111111111111111111111111111001_2 -inv-> 110_2 = 6 = 2 * 3. No smaller prime generates 3. %e A339268 a(3) = 53, because 53 = 110101_2 -inv-> 001010_2 = 10 = 2 * 5. %t A339268 a[n_] := Module[{q = 2*Prime[n], m, r}, m = 2^Ceiling@Log2[q]; r = m - q - 1; While[r < q || ! PrimeQ[r], r += m; m *= 2]; r]; Array[a, 48] (* _Amiram Eldar_, Dec 04 2020 *) %o A339268 (Python) %o A339268 from sympy import isprime %o A339268 from sympy import prime %o A339268 for i in range(1,50): %o A339268 d=2*prime(i) %o A339268 l=len(bin(d).lstrip('0b')) %o A339268 xor=2**l-1 %o A339268 p=d^xor+2**l %o A339268 while not isprime(p): %o A339268 l+=1 %o A339268 p+=2**l %o A339268 print(p,end=', ') %o A339268 (PARI) a(n) = {my(b = apply(x->1-x, binary(2*prime(n))), e=#b, q=fromdigits(b, 2)+2^e); while (!isprime(q), e++; q+=2^e; q); q;} \\ _Michel Marcus_, Dec 04 2020 %Y A339268 Cf. A035327, A339247. %K A339268 nonn,base %O A339268 1,1 %A A339268 _Bob Andriesse_, Nov 29 2020