I wonder if anyone has counted these curves, either exactly or asymptotically?

Let $S_n$ be an $n \times n$ subset of $\mathbb{Z}^2$ consisting of $n^2$
lattice points: a *lattice square*.
Define a *rectilinear filler curve* for $S_n$ to be a simple closed
curve that passes through each of the $n^2$ lattice points,
and is composed entirely of vertical and horizontal edges.
So the curve is what is called a "rectilinear" or "orthogonal" polygon in the literature. Every turn of such a curve is $\pm 90^\circ$.

I'd like to know the number $f(n)$ of distinct filler curves for $S_n$, distinct up to rotations and reflections. So if $C_1$ can be rotated and/or reflected to lay on top of $C_2$, then $C_1$ and $C_2$ are not distinct.

$f(2) = 1$, and $f(4) = 2$:

$f(n)=0$ when $n$ is odd, as can be seen as follows.
View a filler curve $C$ as composed of unit-length segments
connecting lattice points;
call these the *edges* of $C$ (so two incident edges can be collinear).
Each horizontal line $y = m + \frac{1}{2}$ for $m$ an integer
crosses an even number of edges of $C$; similarly for vertical lines.
So the total number of edges $E$ of $C$ is even.
In Euler's relation $V-E+F=2$,
$F=2$ (interior & exterior of $C$). So $V=E$. So $V$ must be even.
But $V=n^2$ for $n$ odd is odd.

Already I don't know what is $f(6)$. It is easy to see the growth of $f$ is exponential in $n$, but I don't know more. In particular, I do not see how to recursively connect $f(n)$ to $f(n-2)$.

countingthese, I believe it amounts to counting spanning trees on a grid (which I think should be known). This is because these curves "go between" a tree and dual tree. See pages 8-9 of arxiv.org/pdf/math/0112234.pdf for more details. $\endgroup$3more comments