def csolve_prime(f, p, e=1):
 from sympy.polys.domains import ZZ
 X1 = [i for i in range(p) if (gf_eval(f, i, p, ZZ) == 0)]
 if (e == 1):
  return X1
 X = []
 S = list(zip(X1, ([1] * len(X1))))
 while S:
  (x, s) = S.pop()
  if (s == e):
   X.append(x)
  else:
   s1 = (s + 1)
   ps = (p ** s)
   S.extend([((x + (v * ps)), s1) for v in _raise_mod_power(x, s, p, f)])
 return sorted(X)

def csolve_prime ( f , p , e = 1 ) : from sympy . polys . domains import ZZ X1 = [ i for i in range ( p ) if ( gf_eval ( f , i , p , ZZ ) == 0 ) ] if ( e == 1 ) : return X1 X = [ ] S = list ( zip ( X1 , ( [ 1 ] * len ( X1 ) ) ) ) while S : ( x , s ) = S . pop ( ) if ( s == e ) : X . append ( x ) else : s1 = ( s + 1 ) ps = ( p ** s ) S . extend ( [ ( ( x + ( v * ps ) ) , s1 ) for v in _raise_mod_power ( x , s , p , f ) ] ) return sorted ( X )
solutions of f(x) congruent 0 mod .