cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A000095 Number of fixed points of GAMMA_0 (n) of type i.

This page as a plain text file.
%I A000095 #33 Aug 20 2025 14:23:02
%S A000095 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,
%T A000095 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,
%U A000095 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
%N A000095 Number of fixed points of GAMMA_0 (n) of type i.
%D A000095 Bruno Schoeneberg, Elliptic Modular Functions, Springer-Verlag, NY, 1974, p. 101.
%D A000095 Goro Shimura, Introduction to the Arithmetic Theory of Automorphic Functions, Princeton, 1971, see p. 25, Eq. (2).
%H A000095 Reinhard Zumkeller, <a href="/A000095/b000095.txt">Table of n, a(n) for n = 1..10000</a>
%F A000095 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
%F A000095 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2/Pi = 0.636619... (A060294). - _Amiram Eldar_, Oct 15 2022
%e A000095 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 + ...
%p A000095 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;
%t A000095 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 ] ] ]
%t A000095 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 *)
%o A000095 (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 */
%o A000095 (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
%o A000095 (Haskell)
%o A000095 a000095 n = product $ zipWith f (a027748_row n) (a124010_row n) where
%o A000095    f 2 e = if e == 1 then 2 else 0
%o A000095    f p _ = if p `mod` 4 == 1 then 2 else 0
%o A000095 -- _Reinhard Zumkeller_, Mar 24 2012
%o A000095 (Python)
%o A000095 from sympy import primefactors
%o A000095 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
%Y A000095 Cf. A027748, A060294, A124010, A000089.
%K A000095 nonn,easy,mult
%O A000095 1,2
%A A000095 _N. J. A. Sloane_
%E A000095 Values a(1)-a(10^4) double checked by _M. F. Hasler_, Mar 24 2012