# Why does $p \equiv 1,2,4 \pmod 7 \iff p \equiv 1,9,25 \pmod {28}$ where $p \equiv 1 \pmod 4$

Why does $p \equiv 1,2,4 \pmod 7 \iff p \equiv 1,9,25 \pmod {28}$

I can find primes and probably work this out but is there a quicker way?

Edit: p is an odd prime and $p \equiv 1 \pmod 4$

• $p$ is meant to be a prime here? Though of course $p=2$ is a counterexample....so I suppose you want it to be an odd prime? – lulu Jun 3 '16 at 15:24
• Yes p cannot be 2 or 7 – jack Jun 3 '16 at 15:25
• $7$ is already ruled out by your congruences. You should edit the question to refelct your meaning. – lulu Jun 3 '16 at 15:26
• It is possible to have a prime congruent to $15$ modulo $28$. I suspect we want to show that $p\equiv$ the various things mod $7$ and $p\equiv 1\pmod{4}$ if and only if the stuff modulo $28$. – André Nicolas Jun 3 '16 at 15:30
• Possible duplicate of Congruences and Legendre – Watson Jun 3 '16 at 18:19