Fermat's Little Theorem :
ap ≡ a (mod p)
According to Modular Arithmetic a ≡ b (mod n) if their difference (a-b) is an integer multiple of n ( n divides (a-b) )
So ( ap - a ) is an integer multiple of p , now as a is not divisible by p so definitely ( ap-1 -1) is an integer multiple of p .this simply means if we divides ap-1 by p , the remainder would be 1 .... ap-1 modulo p = 1
put the values in the formula. p=17 so p-1 =16 .