%I M0188 N0069 #75 Oct 27 2023 19:22:42
%S 0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,1,0,1,1,1,2,2,1,0,2,1,2,2,3,2,1,3,3,
%T 3,1,2,4,3,3,3,5,3,4,3,5,4,3,1,2,5,5,4,4,5,5,5,6,5,7,4,7,5,3,5,9,5,7,
%U 7,9,6,5,5,8,5,8,7,11,6,7,4,9,7,11,7,10,9,9,7,11,7,10,9,11,9,9,7,7,9,7,8,15
%N Genus of modular group Gamma_0(n). Or, genus of modular curve X_0(n).
%C Also the dimension of the space of cusp forms of weight two and level n. - _Gene Ward Smith_, May 23 2006
%D B. Schoeneberg, Elliptic Modular Functions, Springer-Verlag, NY, 1974, p. 103.
%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Gheorghe Coserea, <a href="/A001617/b001617.txt">Table of n, a(n) for n = 1..50000</a> (first 1000 terms from N. J. A. Sloane)
%H J. A. Csirik, M. Zieve, and J. Wetherell, <a href="http://arxiv.org/abs/math/0006096">On the genera of X0(N)</a>, arXiv:math/0006096 [math.NT], 2000.
%H Harriet Fell, Morris Newman, and Edward Ordman, <a href="http://dx.doi.org/10.6028/jres.067B.006">Tables of genera of groups of linear fractional transformations</a>, J. Res. Nat. Bur. Standards Sect. B 67B 1963 61-68.
%H Steven R. Finch, <a href="/A000521/a000521_1.pdf">Modular forms on SL_2(Z)</a>, December 28, 2005. [Cached copy, with permission of the author]
%H Ralf Hemmecke, Peter Paule, and Silviu Radu, <a href="http://www3.risc.jku.at/publications/download/risc_5983/integralbasis.pdf">Construction of Modular Function Bases for Gamma_0(121) related to p*(11*n + 6)</a>, (2019).
%H Nicolas Allen Smoot, <a href="http://www3.risc.jku.at/publications/download/risc_6512/thesis.pdf">Computer algebra with the fifth operation: applications of modular functions to partition congruences</a>, Ph. D. Thesis, Johannes Kepler Univ., Linz (Austria 2022), 33.
%H <a href="/index/Gre#groups_modular">Index entries for sequences related to modular groups</a>
%F a(n) = 1 + A001615(n)/12 - A000089(n)/4 - A000086(n)/3 - A001616(n)/2.
%F From _Gheorghe Coserea_, May 20 2016: (Start)
%F limsup a(n) / (n*log(log(n))) = exp(Euler)/(2*Pi^2), where Euler is A001620.
%F a(n) >= (n-5*sqrt(n)-8)/12, with equality iff n = p^2 for prime p=1 (mod 12) (see A068228).
%F a(n) < n * exp(Euler)/(2*Pi^2) * (log(log(n)) + 2/log(log(n))) for n>=3 (see Csirik link).
%F (End)
%e G.f. = x^11 + x^14 + x^15 + x^17 + x^19 + x^20 + x^21 + 2*x^22 + 2*x^23 + ...
%p nu2 := proc (n) # number of elliptic points of order two (A000089) local i, s; if modp(n,4) = 0 then RETURN(0) fi; s := 1; for i in divisors(n) do if isprime(i) and i > 2 then s := s*(1+eval(legendre(-1,i))) fi od; s end:
%p nu3 := proc (n) # number of elliptic points of order three (A000086) local d, s; if modp(n,9) = 0 then RETURN(0) fi; s := 1; for d in divisors(n) do if isprime(d) then s := s*(1+eval(legendre(-3,d))) fi od; s end:
%p nupara := proc (n) # number of parabolic cusps (A001616) local b, d; b := 0; for d to n do if modp(n,d) = 0 then b := b+eval(phi(gcd(d,n/d))) fi od; b end:
%p A001615 := proc(n) local i,j; j := n; for i in divisors(n) do if isprime(i) then j := j*(1+1/i); fi; od; j; end;
%p genx := proc (n) # genus of X0(n) (A001617) #1+1/12*psi(n)-1/4*nu2(n)-1/3*nu3(n)-1/2*nupara(n) end: 1+1/12*A001615(n)-1/4*nu2(n)-1/3*nu3(n)-1/2*nupara(n) end: # _Gene Ward Smith_, May 23 2006
%t nu2[n_] := Module[{i, s}, If[Mod[n, 4] == 0, Return[0]]; s = 1; Do[ If[ PrimeQ[i] && i > 2, s = s*(1 + JacobiSymbol[-1, i])], {i, Divisors[n]}]; s];
%t nu3[n_] := Module[{d, s}, If[Mod[n, 9] == 0, Return[0]]; s = 1; Do[ If[ PrimeQ[d], s = s*(1 + JacobiSymbol[-3, d])], {d, Divisors[n]}]; s];
%t nupara[n_] := Module[{b, d}, b = 0; For[d = 1, d <= n, d++, If[ Mod[n, d] == 0, b = b + EulerPhi[ GCD[d, n/d]]]]; b];
%t A001615[n_] := Module[{i, j}, j = n; Do[ If[ PrimeQ[i], j = j*(1 + 1/i)], {i, Divisors[n]}]; j];
%t genx[n_] := 1 + (1/12)*A001615[n] - (1/4)*nu2[n] - (1/3)*nu3[n] - (1/2)*nupara[n];
%t A001617 = Table[ genx[n], {n, 1, 102}] (* _Jean-François Alcover_, Jan 04 2012, after _Gene Ward Smith_'s Maple program *)
%t a[ n_] := If[ n < 1, 0, 1 + Sum[ MoebiusMu[ d]^2 n/d / 12 - EulerPhi[ GCD[ d, n/d]] / 2, {d, Divisors @n}] - Count[(#^2 - # + 1)/n & /@ Range[n], _?IntegerQ]/3 - Count[ (#^2 + 1)/n & /@ Range[n], _?IntegerQ]/4]; (* _Michael Somos_, May 08 2015 *)
%o (Magma) a := func< n | n lt 1 select 0 else Dimension( CuspForms( Gamma0(n), 2))>; /* _Michael Somos_, May 08 2015 */
%o (PARI)
%o A000089(n) = {
%o if (n%4 == 0 || n%4 == 3, return(0));
%o if (n%2 == 0, n \= 2);
%o my(f = factor(n), fsz = matsize(f)[1]);
%o prod(k = 1, fsz, if (f[k,1] % 4 == 3, 0, 2));
%o };
%o A000086(n) = {
%o if (n%9 == 0 || n%3 == 2, return(0));
%o if (n%3 == 0, n \= 3);
%o my(f = factor(n), fsz = matsize(f)[1]);
%o prod(k = 1, fsz, if (f[k,1] % 3 == 2, 0, 2));
%o };
%o A001615(n) = {
%o my(f = factor(n), fsz = matsize(f)[1],
%o g = prod(k=1, fsz, (f[k,1]+1)),
%o h = prod(k=1, fsz, f[k,1]));
%o return((n*g)\h);
%o };
%o A001616(n) = {
%o my(f = factor(n), fsz = matsize(f)[1]);
%o prod(k = 1, fsz, f[k,1]^(f[k,2]\2) + f[k,1]^((f[k,2]-1)\2));
%o };
%o a(n) = 1 + A001615(n)/12 - A000089(n)/4 - A000086(n)/3 - A001616(n)/2;
%o vector(102, n, a(n)) \\ _Gheorghe Coserea_, May 20 2016
%Y Cf. A001615, A000089, A000086, A001616, A054728, A091401, A091403, A091404.
%K nonn,easy,nice
%O 1,22
%A _N. J. A. Sloane_