Q:

An assignment problem( in elementary number theory course) on which i am struck and need help

I am trying assignment and I am unable to think about this problem. Can someone please help. 

Question is ->   prove that $ (n-1)^2  $  divides $ n^k -1$ iff (n-1) divides k. 

I shall be really grateful. 

A:

Hint
Let $n-1=m,n=?$
Using binomial expansion,
$$n^k-1=(1+m)^k-1\equiv \binom k1m^1\pmod{m^2}$$

