## how many solution in x^2+y^2=1 ( mod p )

$x^2+y^2=1 ( mod p )$ p is odd prime(4k+1) ,get all solutions ,
$e^{2\pi i}=1$
since $cos^2\frac{{2\pi}}{n} +sin^2\frac{{2\pi}}{n}=1$
$i^2=-1 ( mod p )$
I want to use this solve x^n=1 ( mod p ) for example，
$x^5=1 (mod 41 )$ $x^2+y^2=1 ( mod 41 )$ has 6 solutions (not include trivialsolution )
$9^2=-1( mod 41)$ and $i=9 ( mod 41 )$
so $(x+iy)^5=1 (mod 41)$ $(x+9y)^5=1 (mod 41 )$
or $(y+9x)^5=1 (mod 41 )$ is this effective ?