OFFSET
0,7
COMMENTS
The value of the k-th bit in a(n) corresponds to the most frequent value in the bit triple starting at the k-th bit in n.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8192
Michael De Vlieger, Log log scatterplot of a(n), n = 0..2^20.
FORMULA
a(n) = 0 iff n belongs to A048715.
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 0 10 0
3 1 11 1
4 0 100 0
5 1 101 1
6 3 110 11
7 3 111 11
8 0 1000 0
9 0 1001 0
10 2 1010 10
11 3 1011 11
12 6 1100 110
13 7 1101 111
14 7 1110 111
15 7 1111 111
MATHEMATICA
A342697[n_] := Quotient[7*n - BitXor[n, 2*n, 4*n], 8];
Array[A342697, 100, 0] (* Paolo Xausa, Aug 06 2025 *)
PROG
(PARI) a(n) = sum(k=0, #binary(n), ((bittest(n, k)+bittest(n, k+1)+bittest(n, k+2))>=2) * 2^k)
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Mar 18 2021
STATUS
approved
