Show that if the prime power factorization of n-1 is p1^a1...pt^at and that there exists integers xj , for j = 1,2,3,...,t such that for each j:

xj^[(n-1)/pj] isnot congruentto 1 (mod n)

and

xj^(n-1)is congruentto 1 (mod n)

then n is a prime.

Any ideas on how to prove the above? Thanks