login
Indices of zeros in binary concatenation of primes.
0

%I #23 Dec 31 2024 06:35:55

%S 1,5,11,16,19,20,21,24,25,29,36,44,45,47,50,52,53,56,58,62,69,71,76,

%T 83,86,87,88,89,93,94,95,100,101,103,104,107,108,114,116,117,121,124,

%U 125,129,130,131,132,136,137,139,143,144,150,152,157,160,165,166,167

%N Indices of zeros in binary concatenation of primes.

%C The initial bit is labeled as bit 0.

%e The primes, their binary expansions, and positions of successive zero bits, begin

%e prime 2 3 5 7 11 ...

%e binary 10 11 101 111 1011 ...

%e zeros ^ ^ ^

%e a(n) = 1 5 11 ...

%t seq[lim_] := -1 + Position[Flatten@ IntegerDigits[Prime[Range[lim]], 2], 0] // Flatten; seq[30] (* _Amiram Eldar_, Dec 31 2024 *)

%o (Python)

%o import sympy

%o l = []

%o bin_primes = ""

%o for i in range(1,27):

%o bin_primes += bin(sympy.prime(i))[2:]

%o for i in range(len(bin_primes)):

%o if bin_primes[i] == '0':

%o l.append(i)

%o print(l)

%Y Cf. A003607, A191232.

%K nonn,base

%O 1,2

%A _Alexandre Herrera_, Dec 14 2024