I have a real sequence $(a_p)$ indexed by the prime numbers which takes values -1, 0, or 1, having the property that $a_p=a_q$ whenever $p\equiv q \pmod m$, where $m$ is a fixed integer $>2$. I'm wondering if by extending multiplicatively the sequence over the natural numbers, that is, by imposing $a_{rs}=a_r a_s$ for every natural numbers $r$ and $s$, I obtain a periodic sequence, i.e., $(a_n)$ such that $a_i=a_j$ whenever $i\equiv j \pmod m$.
What kind of sequence should I start with for the extended sequence be periodic modulo $m$?
Do that conditions suffice?
Thanks in advance for any ideas or suggestions.