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”).

Least k such that prime(n) + 2^(k+L) - 2^L is a prime, where L is the length of binary representation of prime(n): L = A070939(A000040(n)). a(n) = -1 if no such k exists.
0

%I #11 Nov 20 2013 13:34:04

%S 1,1,2,2,1,2,4,4,1,2,1,2,1,2,4,2,3,4,1,2,2,1,5,4,1,2,2,4,1,6,18,20,2,

%T 4,2,3,1,4,2,2,3,6,1,12,2,1,1,96,2,4,4,2,2,1,3,3,4,6,6,4,3,6,1,4,1,2,

%U 2,1,56,2,3,8,4,4,3,4,2,4,4,3,4,4,18,20,2,8,2,2

%N Least k such that prime(n) + 2^(k+L) - 2^L is a prime, where L is the length of binary representation of prime(n): L = A070939(A000040(n)). a(n) = -1 if no such k exists.

%C Least number of 1's that must be prepended to the binary representation of prime(n) such that the result is another prime.

%C Prime(n) is in A065047 if and only if a(n) = 1.

%e a(6) = 1 because 13 in binary is 1101, and 29 (11101 in binary) is a prime.

%e a(7) = 2 because 17 in binary is 10001, and 113 (1110001 in binary) is a prime.

%e a(8) = 4 because 19 in binary is 10011, and 499 (111110011 in binary) is a prime.

%Y Cf. A000040, A070939, A065047, A094076, A023758.

%K nonn,base,less

%O 2,3

%A _Alex Ratushnyak_, Nov 17 2013