Constraints: The blocks must be adjacent to each other. i.e. A pair of blocks must have a common edge or vertex. Any shapes that are formed by flipping or rotating or mirroring should be considered to be the same shape.
By manual inspection, for example, For N=2, there are 2 unique shapes in a 2x2 grid
  
For N=3, there are 5 unique shapes in a 3x3 grid
          
I can find the total number of shapes using the combination formula, nCr
For r=2 and n=2x2=4, we get 4C2 = 6 shapes (4+2)
For r=3 and n=3x3=9, we get 9C3 = 84 shapes (6+16+16+8+2) + 36 non-adjacent
Need help in finding out mathematically or algorithm-wise,
- how to identify non-adjacent blocks
- how to identify mirror patterns
- how to identify rotating/flippable patterns
Similar questions were asked in the following links but I wasn't able to extrapolate any concrete solutions.
I tried researching graph theory for ways to identify identical shapes (mirror, rotate, flip).