A334591 Side length of largest triangle of zeros in the XOR-triangle with first row generated from the binary expansion of n.
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
Examples
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
Links
- Peter Kagey, Table of n, a(n) for n = 1..8191
- MathOverflow user DSM, Number triangle
- Index entries for sequences related to binary expansion of n
Programs
-
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 *)
Comments