By Fermat's little theorem we know that


$$b^{p-1}=1 \mod p$$


if p is prime and $\gcd(b,p)=1$. On the other hand, I was wondering whether


$$b^{n-1}=-1 \mod n$$


can occur at all?


Update: sorry, I meant n odd. Please excuse.



b^(n-1)=-1 mod n
There are no solutions to $b^{n-1}\equiv-1\pmod n$ with $n$ odd. 


Let $n>1$ be odd. Every prime dividing $n$ can be written as $2^km+1$ for some positive $k$ and some odd integer $m$. Among those primes, let $p$ have the minimal value of $k$. Then $n-1=2^kr$ for some integer $r$. If 
$b^{n-1}\equiv-1\pmod n$ then $b^{n-1}\equiv-1\pmod p$ so $b^{(n-1)m}\equiv(-1)^m\equiv-1\pmod p$ and 
$\gcd(b,p)=1$. But $b^{(n-1)m}=b^{2^kmr}=b^{(p-1)r}\equiv1\pmod p$ by little Fermat. Contradiction, QED. 


