login
A334591
Side length of largest triangle of zeros in the XOR-triangle with first row generated from the binary expansion of n.
9
0, 1, 1, 2, 1, 1, 2, 3, 2, 2, 1, 2, 1, 2, 3, 4, 3, 2, 2, 2, 3, 1, 2, 3, 2, 2, 1, 2, 2, 3, 4, 5, 4, 3, 3, 2, 2, 3, 2, 3, 2, 4, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 3, 1, 2, 3, 2, 2, 2, 3, 3, 4, 5, 6, 5, 4, 4, 3, 3, 3, 3, 3, 2, 3, 2, 4, 3, 2, 3, 4, 3, 2, 2, 4, 5, 3, 3
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.
Records occur at a(2^n) = n.
Ones occur at 2, 3, 5, 6, 11, 13, 22, 27, 45, 54, 91, 109, 182, 219, 365, 438, 731, 877, 1462,...
a(n) <= A087117(n).
EXAMPLE
For n = 53, a(53) = 3 because 53 = 110101_2 in binary, and the largest triangle of 0s in the corresponding XOR-triangle has size 3 (see third, fourth, and fifth rows):
1 1 0 1 0 1
0 1 1 1 1
1 0 0 0
1 0 0
1 0
1
MATHEMATICA
Array[Function[w, Max@ Flatten@ Array[If[# == 1, If[First@ # == 1, Nothing, Length@ #] & /@ Split@ w[[#]], If[First@ # == -1, Length@ #, Nothing] & /@ Split[w[[#]] - Most@ w[[# - 1]] ] ] &, Length@ w] /. -Infinity -> 0]@ NestWhileList[Map[BitXor @@ # &, Partition[#, 2, 1]] &, IntegerDigits[#, 2], Length@ # > 1 &] &, 105] (* Michael De Vlieger, May 08 2020 *)
KEYWORD
nonn,base
AUTHOR
Peter Kagey, May 07 2020
STATUS
approved