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

A331852
a(n) is the number of distinct values obtained by partitioning the binary representation of n into consecutive blocks, and then applying the bitwise XOR operator to the numbers represented by the blocks.
2
1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 8, 8, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 10, 10, 9, 9, 10, 10, 9, 9, 10, 10, 11, 11, 11, 11, 9, 9, 8, 8, 7, 7, 10, 10, 10, 10, 11, 11, 10, 10, 11, 11, 11, 11, 12
OFFSET
0,3
FORMULA
a(2^k) = k+1 for any k >= 0.
Apparently a(2^k-1) = A038348(k) for any k >= 0.
EXAMPLE
For n = 6:
- the binary representation of 6 is "110",
- we can split it in 4 ways:
"110" -> 6
"1" and "10" -> 1 XOR 2 = 3
"11" and "0" -> 3 XOR 0 = 3
"1" and "1" and "0" -> 1 XOR 1 XOR 0 = 0
- we have 3 distinct values,
- hence a(6) = 3.
PROG
(PARI) See Links section.
CROSSREFS
See A331851 for similar sequences.
Cf. A038348.
Sequence in context: A182008 A375024 A106457 * A379771 A103128 A156080
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 29 2020
STATUS
approved