bridge/class-master/depend/pari/src/basemath/arith1.c
/*********************************************************************/
/**                                                                 **/
/**                     INVERSE TOTIENT FUNCTION                    **/
/**                                                                 **/
/*********************************************************************/
/* N t_INT, L a ZV containing all prime divisors of N, and possibly other
 * primes. Return factor(N) */
INVERSE TOTIENT FUNCTION

N t_INT, L a ZV containing all prime divisors of N, and possibly other
primes.
INVERSE TOTIENT FUNCTION N t_INT L a ZV containing all prime divisors of N and possibly other primes .
GEN
Z_factor_listP(GEN N, GEN L)
{
  long i, k, l = lg(L);
  GEN P = cgetg(l, t_COL), E = cgetg(l, t_COL);
  for (i = k = 1; i < l; i++)
  {
    GEN p = gel(L,i);
    long v = Z_pvalrem(N, p, &N);
    if (v)
    {
      gel(P,k) = p;
      gel(E,k) = utoipos(v);
      k++;
    }
  }
  setlg(P, k);
  setlg(E, k); return mkmat2(P,E);
}
GEN Z_factor_listP ( GEN N , GEN L ) { long i , k , l = lg ( L ) ; GEN P = cgetg ( l , t_COL ) , E = cgetg ( l , t_COL ) ; for ( i = k = 1 ; i < l ; i ++ ) { GEN p = gel ( L , i ) ; long v = Z_pvalrem ( N , p , & N ) ; if ( v ) { gel ( P , k ) = p ; gel ( E , k ) = utoipos ( v ) ; k ++ ; } } setlg ( P , k ) ; setlg ( E , k ) ; return mkmat2 ( P , E ) ; }
INVERSE TOTIENT FUNCTION
INVERSE TOTIENT FUNCTION