

A276561


For nth 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 p(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
(list;
graph;
refs;
listen;
history;
text;
internal format)



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.


LINKS

Table of n, a(n) for n=1..113.


EXAMPLE

Since prime(9) = 29 = (11101)_2, a(9) = (110)_2 = 6.


PROG

(Sagemath)
a = []
for p in xrange(3, 1000):
if is_prime(p):
t = p  (1<<int(floor(log(float(p))/log(2.0))))
a.append(t>>1)
print a


CROSSREFS

Cf. A000215, A019434.
Sequence in context: A257783 A226874 A267901 * A153506 A271701 A271699
Adjacent sequences: A276558 A276559 A276560 * A276562 A276563 A276564


KEYWORD

nonn,base


AUTHOR

Adnan Baysal, Apr 10 2017


STATUS

approved



