The theorems of Fermat,Euler and Wilson, primitive roots and indices