If anyone has been following this, the Maple programs were still not
entirely correct, as A000089 was wrong. I'll send in a correction.<br>
<br>
Here's a correct Maple program for the genus of X0(N):<br>
<br>
psi := proc (n) <br>
# Dedekind psi function<br>
local i, j; <br>
j := n; <br>
for i in divisors(n) do <br>
if isprime(i) then <br>
j := j*(1+1/i) fi od; <br>
j end:<br>
<br>
nu2 := proc (n) <br>
# number of elliptic points of order two<br>
local i, s; <br>
if modp(n,4) = 0 then RETURN(0) fi; <br>
s := 1; <br>
for i in divisors(n) do <br>
if isprime(i) and i > 2 then <br>
s := s*(1+legendre(-1,i)) fi od; <br>
s end:<br>
<br>
nu3 := proc (n) <br>
# number of elliptic points of order three<br>
local d, s; <br>
if modp(n,9) = 0 then RETURN(0) fi;<br>
s := 1; <br>
for d in divisors(n) do <br>
if isprime(d) then s := s*(1+legendre(-3,d)) fi od;<br>
s end:<br>
<br>
nupara := proc (n) <br>
# number of parabolic cusps<br>
local b, d; <br>
b := 0; <br>
for d to n do <br>
if modp(n,d) = 0 then <br>
b := b+phi(gcd(d,n/d)) fi od;<br>
b end:<br>
<br>
genx := proc (n)<br>
# genus of X0(n) <br>
1+1/12*psi(n)-1/4*nu2(n)-1/3*nu3(n)-1/2*nupara(n) end:<br>
<br><br><br>