Applying Fermat's Little Theorem: $6^{1987}$ divided by $37$ Find the remainder when $6^{1987}$ is divided by $37$.
Because 37 is prime we have: $6^{36}$ mod $37 = 1$. I tried to get a nice combination like: $1987 = 36 * 55 + 7$, so we would have $(6^{36})^{55}6^{7}=6^{1987}$.
Then, I've taken mod $37$, which is: $6^{1987}$ mod $37=1^{55}(6^7$ mod $37)$. I need to find $6^7$ mod $37$. What can I do from here?
Of course, any other method (solution) for finding the remainder would be great.

Hint $\rm\ mod\ n^2+1\!:\,\ \color{#c00}{n^2}\equiv -1 \ \Rightarrow\, n^{4k+3}\! = n(\color{#c00}{n^2})^{2k+1} \equiv - n.\ $  Yours is special case $\,\rm n=6.$
