Can anyone explain to me what the description of https://oeis.org/A227259 means?
Number of n X 2 0,1 arrays indicating 2 X 2 subblocks of some larger (n+1) X 3 binary array having a sum of two or less, with rows and columns of the latter in lexicographically nondecreasing order.
If you could just explain it enough so that I could verify the first three or four values, that'd be great. I can't even figure out WTF it's trying to describe.
The background is that I've got a different (much simpler to describe) sequence that matches this sequence as far as shown and that (provably) matches the formula listed there as "Empirical", but the OEIS editors won't add my comment with the simpler description unless I say "conjecture" or can prove some sort of equivalence with the monster that's there as the current sequence name.
EDIT: Nevermind, found the bug in my code. Bug is corrected below.
Here's my interpretation of the sequence if I'm guided by what people have been saying in the comments; it doesn't match the sequence in OEIS, so I hope someone who understands the interpretation in the comments and has code to verify the first several values can write an answer explaining what their code is doing.
import numpy as np
from scipy.ndimage import convolve
def gen_acceptable_mat(rows, cols):
for worknum in range(2**(rows*cols)):
binval = bin(worknum).replace('0b', '')
binval = ('0' * (rows*cols - len(binval))) + binval
flat = np.array([int(x) for x in binval],dtype=np.dtype('b'))
mat = np.reshape(flat, (rows, cols))
g = [ ''.join(str(t) for t in row) for row in mat ]
if g != sorted(g):
continue
g = [ ''.join(str(t) for t in row) for row in np.transpose(mat) ]
if g != sorted(g):
continue
yield mat
# original buggy line:
# ul_kernel = np.array([[1,1,0],[1,0,0],[0,0,0]], dtype='b')
ul_kernel = np.array([[1,1,0],[1,1,0],[0,0,0]], dtype='b')
if __name__ == '__main__':
for npone in range(2,8):
acceptable = list(gen_acceptable_mat(npone, 3))
twobytwos = [(convolve(j, ul_kernel, mode='constant', cval=0) <= 2)[:-1,:-1].astype(int) for j in acceptable]
print(np.unique(twobytwos, axis=0).shape[0])
This gives me 3, 9, 20, 40, 74, 128
With the fix, this gives me matching values.
Okay, now to line these values up with my simpler description...
Here are the $23$ solutions for $n=3$:
If you point out one that you are missing, I'll show you a corresponding $4 \times 3$ array.