OFFSET
1,3
COMMENTS
To each principal congruence subgroup Gamma(n) of the modular group Gamma = PSL(2,Z) there corresponds a regular triangular map (it is the quotient of the Farey map by Gamma(n)). A Petrie polygon is a closed left-right zig-zagging path on the map. a(n) is the number of such paths.
LINKS
Tom Harris, Table of n, a(n) for n = 1..1000
F. Klein, Ueber die Transformation siebenter Ordnungder elliptischen Funktionen, Mathematische Annalen, 14 (1878), 428-471.
D. Singerman and J. Strudwick, Petrie polygons, Fibonacci sequences and Farey maps, Ars Mathematica Contemporanea, 10 (2016), 349-357.
EXAMPLE
The regular triangular map corresponding to Gamma(3) is the tetrahedron; one can easily check by hand that there are 3 distinct closed left-right zigzag paths (Petrie polygons) along the edges of the tetrahedron, so a(3) = 3.
Similarly, there are a(4) = 4 and a(5) = 6 such paths on the octahedron and the icosahedron, the maps corresponding to Gamma(4), and Gamma(5) respectively.
The map corresponding to Gamma(7) is the Klein map on his quartic curve. There are 21 Petrie polygons on this map; Klein drew 3 of them in his 1878 paper on the quartic, and the others can be found by rotating these through 2*Pi*k/7, k=1,...,6.
MATHEMATICA
b[n_] := (n^3/2) Times @@ (1-1/Select[Range[n], Mod[n, #] == 0 && PrimeQ[#]&]^2);
c[n_] := With[{F = Fibonacci}, For[k = 1, True, k++, If[Mod[F[k], n] == 0 && (Mod[F[k+1], n] == 1 || Mod[F[k+1], n] == n-1), Return[k]]]];
a[n_] := If[n<3, 1, b[n]/c[n]];
Array[a, 60] (* Jean-François Alcover, Jun 11 2021 *)
Table[((n^3/2^Boole[n > 1]) Product[1 - 1/k^2, {k, Select[Divisors[n], PrimeQ]}])/NestWhile[# + 1 &, 1, ! (Mod[Fibonacci[#], n] == 0 && With[{f = Mod[Fibonacci[# + 1], n]}, f == 1 || f == n - 1]) &], {n, 60}] (* Jan Mangaldan, Sep 12 2021 *)
PROG
(Python)
from sympy import primedivisors
def a(n):
# degenerate cases
if n == 1 or n == 2:
return 1
# calculate index of Γ(n) in Γ
index = n**3
for p in primefactors(n):
index *= (p**2 - 1)
index //= p**2
index //= 2
# calculate pisano semiperiod
sigma = 1
a, b = 1, 1
while (a, b) != (0, 1) and (a, b) != (0, n - 1):
a, b = b, (a + b) % n
sigma += 1
# number of petrie polygons = index / sigma
return index // sigma
CROSSREFS
KEYWORD
nonn,easy,walk
AUTHOR
Tom Harris, Jun 10 2021
STATUS
approved