The below texts are from the book Introduction to Analytic Number Theory by Apostol:
$(n|p)$ takes only values $0$, $1$ and $-1$. On the other hand $\chi(n)$ takes other values as well. For example the following table is $\chi(n) \mod 7$:
The book uses some similarities to say their equality without any proof. So how $(n|p) = \chi (n)$ (a maths proof), esp with the mentioned counterexample?


A Dirichlet character is, by definition, a map $\chi:\mathbb{Z}_n^*\rightarrow \mathbb{C}: a \mapsto \chi(a)$ such that $\chi(ab) = \chi(a)\chi(b)$. If $\mathbb{Z}_n^*$ is cyclic (this is the case when $n = 1,2,4,p^k,2p^k$ see the primitive root theorem) it has a generator $g$. This means that every element of $\mathbb{Z}_n^*$ can be written as $g^i$ for some integer $i$. From this we conclude that once we know $\chi(g)$, the entirety of $\chi$ is known for the whole of $\mathbb{Z}_n^*$. Moreover every element of $\mathbb{Z}_n^*$ has finite order so every value $\chi(a)$ is a root of unity in the complex number system. That is why there are exactly $\phi(n)$ characters. In the example you gave one can take as generator $g = 3$ (or $5$). As you see in the column headed by $3$, each of the values of the sixth roots of unity $\omega^i$ occurs exactly once. The character that maps $g$ to $-1$ is the Legendre symbol, this can easily be seen by noting that elements $g^i$ where $i$ is even are mapped to $1$ and are at the same time quadratic residues, and that the elements $g^i$ where i is odd are mapped to $-1$ and are non quadratic residues.