Quoted By:
G is size
X is segment startX
Y is segment startY
S is segment length downards
The function is equivalent to the binary (little edian) to decimal of the segment
The column is 3 blacks 3 whites.. 1 white... 4 blacks... Etc
The second column is the inverse of the first column shifted up once
And that's as far as I've got