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

A276561
For n-th odd prime prime(n) in binary form, a(n) is the decimal value of the bits in between the most significant and least significant bits which are both 1. Since there are no middle bits for odd_prime(1) = 3 = (11)_2, a(1) = 0.
0
0, 0, 1, 1, 2, 0, 1, 3, 6, 7, 2, 4, 5, 7, 10, 13, 14, 1, 3, 4, 7, 9, 12, 16, 18, 19, 21, 22, 24, 31, 1, 4, 5, 10, 11, 14, 17, 19, 22, 25, 26, 31, 32, 34, 35, 41, 47, 49, 50, 52, 55, 56, 61, 0, 3, 6, 7, 10, 12, 13, 18, 25, 27, 28, 30, 37, 40, 45, 46, 48, 51, 55, 58, 61, 63, 66, 70, 72, 76, 81, 82, 87, 88, 91, 93, 96, 100, 102, 103, 105, 111, 115, 117, 121, 123, 126, 4, 5, 14, 17, 22, 25, 28, 29, 32, 37, 40, 43, 44, 47, 50, 52, 53
OFFSET
1,5
COMMENTS
Sequence of prime numbers can be used as a pseudo random bit sequence. But, since for every odd prime the most and least significant bits are 1, this introduces redundancy into this sequence. Removing the first and last bits therefore makes sense. Zeros in a(n) are primes of the form 2^k + 1, for which k must be a power of two, hence zeros of a(n) corresponds to Fermat primes.
FORMULA
a(n) = A164089(prime(n+1)). - Michel Marcus, May 29 2019
EXAMPLE
Since the 9th odd prime is 29 = (11101)_2, a(9) = (110)_2 = 6.
PROG
(SageMath)
a = []
for p in range(3, 1000):
if is_prime(p):
t = p - (1<<int(floor(log(float(p))/log(2.0))))
a.append(t>>1)
print(a)
(PARI) a(n) = my(b = binary(prime(n+1))); fromdigits(vector(#b-2, k, b[k+1]), 2); \\ Michel Marcus, May 29 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Adnan Baysal, Apr 10 2017
STATUS
approved