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).
LINKS
Peter Kagey, Table of n, a(n) for n = 1..8191
MathOverflow user DSM, Number triangle
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 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Peter Kagey, May 07 2020
STATUS
approved