1. ### Digraph and linked list

Can anyone explain this? How to get head, tail, vert and next?
2. ### Prove n is prime (linked to Fermats little theorem)

Show that n is prime iff a^{n-1} ≡ 1( \textrm{mod} n) for 1 \leq a \leq n-1. => Fermats little theorem. <= (Wondering) Perhaps show that \phi(n) = n-1 but if this is the case I would need a way to start.