TITLE: Counting Hamiltonian cycles in $n \times n$ square grid
QUESTION [10 upvotes]: 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)$.

REPLY [3 votes]: This is a summary of the sprawling comments above.
This is OEIS sequence http://oeis.org/A209077 (number of isomorphism classes of Hamiltonian circuits on $2n \times 2n$ grid).
Ed Wynn discussed a method of computing these in https://arxiv.org/abs/1402.0545 and extended the known values from $1 \le n \le 4$ to $1 \le n \le 10$.
In particular, for the 6 by 6 grid (where $n=3$) which was asked about in the question, there are 149 of these circuits up to reflections and rotations.