PUZZLE IBM-290
Counting odd polyominoes
IBM Research · Ponder This · 2022-06
IBM Ponder This #290 · June 2022
Counting odd polyominoes
A polyomino is a generalization of dominoes and Tetris shapes: a connected set of cells on the 2D grid. Dominoes consist of two cells while Tetris shapes consist of four; a general polyomino has
We consider two polyominoes to be distinct even if they can be rotated/reflected into one another. In this approach, there are 2 distinct domino shapes and 19 distinct Tetris shapes:

It is easy to check that the sequence of the number of polyominoes of size
Since polyominoes are sets of 2D grid elements, we can associate a coordinate (a,b) with every cell, and we can use this to define order on cells. We define two such orders:
-
("left-right and then down-up"):
-
("down-up and then right-left"):
Given a polyomino, we can sort its cells according to one of the orders and number them accordingly. Define a function
For example:

It is easy to see that
If we count only polyominoes giving rise to odd permutations, we can see the resulting sequence starts with
Your goal: Find the above sequence of odd polyominoes up to
A bonus "*" will be given for finding the sequence up to
Solution
Best opened after a real attemptTo be added.