OFFSET
1,4
COMMENTS
An XOR-triangle is an inverted 0-1 triangle formed by choosing a top row and having each entry in the subsequent rows be the XOR of the two values above it.
Conjecture: Records occur at powers of two.
LINKS
Peter Kagey, Table of n, a(n) for n = 1..8191
MathOverflow user DSM, Number triangle
EXAMPLE
For n = 53, a(53) = 9 because 53 = 110101_2 in binary, and the corresponding XOR-triangle has 9 zeros:
1 1 0 1 0 1
0 1 1 1 1
1 0 0 0
1 0 0
1 0
1
MATHEMATICA
Array[Count[Flatten@ NestWhileList[Map[BitXor @@ # &, Partition[#, 2, 1]] &, IntegerDigits[#, 2], Length@ # > 1 &], 0] &, 77] (* Michael De Vlieger, May 08 2020 *)
PROG
(PARI) a(n) = {my(b=binary(n), nb=#b-hammingweight(n)); for (n=1, #b-1, b = vector(#b-1, k, bitxor(b[k], b[k+1])); nb += #b-vecsum(b); ); nb; } \\ Michel Marcus, May 08 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Peter Kagey, May 07 2020
STATUS
approved