# Why $1$ is the only quadratic residue modulo $8$?

I'm trying to understand the Proposition 5.1.1 - Ireland and Rosen, A Classical Introduction to Modern Number Theory, p.50, however, I can't understand why this argument is true: $1$ is the only quadratic residue mod $8$. I wrote a program to generate all quadratic residue modulo $8$, from $0$ to $7$

0 -> 0
1 -> 1
4 -> 4
9 -> 1
16 -> 0
25 -> 1
36 -> 4
Press any key to continue . . .


I saw $4$ there, so how come only $1$ satisfied?

The original text was,

Thank you,

@Bill Dubuque: Thank you for the reference.

-
note the $(a,m)=1$ part of the hypothesis. – yoyo Apr 7 '11 at 0:31

Quadratic residues are usually taken from the unit group. $2$ is not in $U_8$. The wikipedia article mentions this issue, citing Ireland and Rosen.
@Chan, by definition, those coprime with $m$. – lhf Apr 7 '11 at 0:27
@Chan, btw, note the hypothesis $(a,m)=1$ in the proposition you cited. – lhf Apr 7 '11 at 0:35