A000095 Number of fixed points of GAMMA_0 (n) of type i.
1, 2, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0
Offset: 1
Examples
G.f. = x + 2*x^2 + 2*x^5 + 4*x^10 + 2*x^13 + 2*x^17 + 2*x^25 + 4*x^26 + 2*x^29 + ...
References
- Bruno Schoeneberg, Elliptic Modular Functions, Springer-Verlag, NY, 1974, p. 101.
- Goro Shimura, Introduction to the Arithmetic Theory of Automorphic Functions, Princeton, 1971, see p. 25, Eq. (2).
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a000095 n = product $ zipWith f (a027748_row n) (a124010_row n) where f 2 e = if e == 1 then 2 else 0 f p _ = if p `mod` 4 == 1 then 2 else 0 -- Reinhard Zumkeller, Mar 24 2012
-
Maple
A000095 := proc(n) local b,d: if irem(n,4) = 0 then RETURN(0); else b := 1; for d from 2 to n do if irem(n,d) = 0 and isprime(d) then b := b*(1+legendre(-1,d)); fi; od; RETURN(b); fi: end;
-
Mathematica
A000095[ 1 ] = 1; A000095[ n_Integer ] := If[ Mod[ n, 4 ]==0, 0, Fold[ #1*(1+JacobiSymbol[ -1, #2 ])&, If[ EvenQ[ n ], 2, 1 ], Select[ First[ Transpose[ FactorInteger[ n ] ] ], OddQ ] ] ] a[ n_] := If[ n < 1, 0, Times @@ (Which[# == 1, 1, # == 2, 2 Boole[#2 == 1], Mod[#, 4] == 1, 2, True, 0] & @@@ FactorInteger[n])]; (* Michael Somos, Nov 15 2015 *)
-
PARI
{a(n) = my(t); if( n<=1 || n%4==0, n==1, t=1; fordiv(n, d, if( isprime(d), t *= (1 + kronecker(-1, d)))); t)}; /* Michael Somos, Jul 15 2004 */
-
PARI
A000095(n)=n%3 && n%4 && n%7 && n%11 && return(prod(k=1,#n=factor(n)[,1],1+kronecker(-1,n[k]))) /* the n%4 is needed, the others only reduce execution time by 34% */ \\ M. F. Hasler, Mar 24 2012
-
Python
from sympy import primefactors def A000095(n): return 0 if n%4==0 or (f:=primefactors(n)) and any(p%4==3 for p in f) else 2**len(f) # David Radcliffe, Aug 20 2025
Formula
a(n) is multiplicative with a(2) = 2, a(2^e) = 0 if e>1, a(p^e) = 2 if p == 1 mod 4 and a(p^e) = 0 if p == 3 mod 4. - Michael Somos, Jul 15 2004
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2/Pi = 0.636619... (A060294). - Amiram Eldar, Oct 15 2022
Extensions
Values a(1)-a(10^4) double checked by M. F. Hasler, Mar 24 2012