bridge/class-master/depend/pari/src/basemath/mftrace.c
/* number of primitive characters modulo N */
number of primitive characters modulo N
number of primitive characters modulo N
static ulong
numprimchars(ulong N)
{
  GEN fa, P, E;
  long i, l;
  ulong n;
  if ((N & 3) == 2) return 0;
  fa = myfactoru(N);
  P = gel(fa,1); l = lg(P);
  E = gel(fa,2);
  for (i = n = 1; i < l; i++)
  {
    ulong p = P[i], e = E[i];
    if (e == 2) n *= p-2; else n *= (p-1)*(p-1)*upowuu(p,e-2);
  }
  return n;
}
static ulong numprimchars ( ulong N ) { GEN fa , P , E ; long i , l ; ulong n ; if ( ( N & 3 ) == 2 ) return 0 ; fa = myfactoru ( N ) ; P = gel ( fa , 1 ) ; l = lg ( P ) ; E = gel ( fa , 2 ) ; for ( i = n = 1 ; i < l ; i ++ ) { ulong p = P [ i ] , e = E [ i ] ; if ( e == 2 ) n *= p - 2 ; else n *= ( p - 1 ) * ( p - 1 ) * upowuu ( p , e - 2 ) ; } return n ; }
number of primitive characters modulo N
number of primitive characters modulo N