OFFSET
0,3
COMMENTS
This sequence is a variant of A342698; here the value of the k-th bit of a(n) is the less frequent value in the bit triple centered around the k-th bit of n.
LINKS
EXAMPLE
The first terms, in decimal and in binary, are:
n a(n) bin(n) bin(a(n))
-- ---- ------ ---------
0 0 0 0
1 0 1 0
2 2 10 10
3 0 11 0
4 7 100 111
5 0 101 0
6 0 110 0
7 0 111 0
8 15 1000 1111
9 6 1001 110
10 10 1010 1010
11 0 1011 0
12 3 1100 11
13 0 1101 0
14 0 1110 0
15 0 1111 0
PROG
(PARI) a(n) = my (w=#binary(n)); sum(k=0, w-1, ((bittest(n, (k-1)%w)+bittest(n, k%w)+bittest(n, (k+1)%w))<=1) * 2^k)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 18 2021
STATUS
approved
