Let T be a once-punctured torus, and fix a,b a generating set of π1(T). Given any closed curve γ on the once-punctured torus T, written as a cyclic word in a,b,A,B (with A = a−1, B = b−1), this tool runs the algorithm of Baroni–Fisac–Liu to produce the exact counting function
\[ N_\gamma(L) \;=\; \#\{\alpha \in \mathrm{Mod}(T)\cdot\gamma \;:\; \ell(\alpha)=L\} \]
where \(\ell\) denotes the word length in π1(T)=F2. Then it plots the counting function for word-lengths up to L = 100. The closed form is built from
\[ \varphi_{P,Q}(L) \;:=\; \#\{(x,y)\in\mathbb{Z}_{>0}^{2} \;:\; Px+Qy=L,\ \gcd(x,y)=1\}, \]
the number of primitive positive solutions of Px+Qy=L.
Examples:
a
aabAB
abaBabAB
a⁴b²
a³b³
aabbAAb
a²b²A²b²Ab
loading the Python runtime…
Table of values
Method and proofs are in Exact curve counting of given word length on the once-punctured torus (F. Baroni, D. Fisac, M. Liu), where the count has the shape
\[ N_\gamma(L) \;=\; m\!\left(\sum_{i} \varphi_{P_i,Q_i}(L-4K_i) \;+\; C_i(L)\right), \]
with Ci(L) explicit periodic corrections and m = 2 when the stabiliser of γ in Mod(T) has non-trivial torsion, and m = 4 otherwise.