OFFSET
1,1
COMMENTS
Conjecture: a(n) > 0 for all n.
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
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..6704
EXAMPLE
a(1) = 11, because 11 = 1011_2 -inv-> 0100_2 = 4 = 2 * 2.
a(2) = 549755813881, because 549755813881 = 111111111111111111111111111111111111001_2 -inv-> 110_2 = 6 = 2 * 3. No smaller prime generates 3.
a(3) = 53, because 53 = 110101_2 -inv-> 001010_2 = 10 = 2 * 5.
MATHEMATICA
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 *)
PROG
(Python)
from sympy import isprime
from sympy import prime
for i in range(1, 50):
d=2*prime(i)
l=len(bin(d).lstrip('0b'))
xor=2**l-1
p=d^xor+2**l
while not isprime(p):
l+=1
p+=2**l
print(p, end=', ')
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bob Andriesse, Nov 29 2020
STATUS
approved