2

I have noticed that all squares, at least up to $19 ^ 2$ can be written as: $a^2 = 5k + p$, where $a \in \mathbb{Z}+\neq 1$ and $k \in \mathbb{Z}+$ and $p = \{0,\pm1\}$

Some examples:

$4^2 = 5 \cdot 3 + 1$

$13^2 = 5 \cdot 34 - 1 $

What is the intuitive and formal proof to see this?

Bill Dubuque
  • 272,048
ESCM
  • 3,161
  • $!\large \begin{align} \bmod 5!:,\ n\ &\equiv 0,\pm1,\pm2\ \Rightarrow, n^2&\equiv 0,\ \ \ 1,-1\end{align}\ \ $ – Bill Dubuque Aug 16 '19 at 22:28
  • It isn't clear what Readers should understand your intuition is based on. One point to make is that for nonzero residues $a \bmod 5$ (or any prime modulus), $a^2 \equiv (-a)^2 \bmod 5$, so that one may expect there to be half as many nonzero squares (quadratic residues) $\bmod 5$ as there are nonzero residues. This turns out to be true (setting aside the zero residue as a special case, since $0 = -0$. – hardmath Aug 16 '19 at 22:31
  • Slightly deeper: by little Fermat $\large \bmod 5!:\ n\not\equiv 0,\Rightarrow, (n^2)^2\equiv 1,\Rightarrow, n^2\equiv \pm1. \ $ See my answer in the linked dupe for a rigorous proof of the hint in my prior comment. – Bill Dubuque Aug 16 '19 at 22:47

4 Answers4

2

The formal reason for this is that $a^2$, modulo $5$, has remainders of $0,1,4$ only (i.e., $0^2 \equiv 0 \pmod 5$, $1^2 \equiv 4^2 \equiv 1 \pmod 5$ and $2^2 \equiv 3^2 \equiv 4 \pmod 5$). For these, the amount to add to get a multiple of $5$ would be $0,-1,1$.

As for what may be considered an "intuitive" way, consider that $x^2 \equiv (-x)^2 \pmod 5$ (actually, it's true for all moduli). Thus, you have the possible remainders, when divide by $5$, being those of just $0$, $1$ (as $-1 \equiv 4 \pmod 5$ gives the same remainder) and $2$ (as $-2 \equiv 3 \pmod 5$ gives the same remainder). Checking just these $3$ values, you get $0,1,4$, as mentioned above.

John Omielan
  • 47,976
  • And the intuitive way?(that i think is more important) – ESCM Aug 16 '19 at 22:26
  • @EduardoS. I'm not sure of anything which may necessarily be considered "intuitive", but I explained how you only need to check $3$ values due to the squares of negative values being the same. – John Omielan Aug 16 '19 at 22:31
0

Every integer is of one of the forms

$$5k, 5k+1, 5k+2, 5k+3, 5k+4.$$

If you square these you get

$$25k^2=5n$$

$$25k^2+10k+1 = 5n+1$$

$$25k^2+20k+4= 5n+4$$

$$25k^2+30k+9 = 5n+4$$

$$25k^2+40k+16 = 5n+1$$

0

Every integer $a$ is congruent, modulo $5$ to $0,\pm 1$ or $\pm2$. So its square is $$a^2\equiv \begin{cases}0^2=0&\text{or} \\(\pm 1)^2=1&\text{or} \\(\pm2)^2=4\rlap{\equiv -1,}\end{cases}\mod 5.$$

Bernard
  • 175,478
0

Say we want to consider $b^2$. We look at $b$ modulo $5$, $b = 5c+d$, where $c$ is an integer and $d$ is one of $0$, $1$, $2$, $3$, or $4$. Then $$ b^2 = (5c+d)^2 = 25c^2 + 10c d + d^2 \text{.} $$ The part "$25 c^2 + 10 c d$" is a multiple of $5$, so can be collected into $k$. This leaves $d^2$. We show in a table that $d^2$ is congruent to $0$ or $\pm 1$ modulo $5$ for each choice of $d$. \begin{align*} &d & &d^2 \\ &0 & &0 \\ &1 & &1 \\ &2 & &4 \cong -1 \pmod{5} \\ &3 & &9 \cong -1 \pmod{5} \\ &4 & &16 \cong 1 \pmod{5} \text{.} \end{align*}

In addition to showing that every $b$ squares to a multiple of $5$ or $\pm 1$ from a multiple of $5$, we can read from the table which of these cases occurs since $d \cong b \pmod{5}$.

Eric Towers
  • 67,037