# On calculating $\sigma(n^2) \pmod 4$ if $n$ is odd

This will be my very first post in math.stackexchange, so please bear with me if I make any silly mistakes with my maths.

So, to proceed: I am trying to calculate $\sigma(n^2) \mod 4$, given that $n$ is odd.

If I let $n = \displaystyle\prod_{i=1}^{r}{{p_i}^{{\alpha}_i}}$, then by considering the cases $p_i \equiv 1 \pmod 4$ and $p_i \equiv 3 \pmod 4$ separately (and taking the exponents ${\alpha}_i$ into consideration as well), I am led to the final congruence relation:

$$\sigma(n^2) \equiv (-1)^c \pmod 4,$$

where $$c = \left|\left\{i|1 \le i \le r, p_i \equiv 1 \pmod4, 2 \nmid {\alpha}_i \right\}\right|.$$

My question now would be: Is this as far as we could go with this congruence? I mean, is there no further possible improvement to this congruence, as far as computing $\sigma(n^2) \pmod 4$ for odd $n$ is concerned?

Appreciate any of your replies/feedback on this.

Edit: In response to Marvis's inquiry as to what sort of improvement I am looking at - I am trying to determine whether $\sigma(n^2) \equiv 1 \pmod 4 \hspace{0.10in} XOR \hspace{0.10in} \sigma(n^2) \equiv 3 \pmod 4$, given that I also know that $4 \nmid \left(\sigma(n) - 2\right)$.

-
In response to Marvis, I am hereby copying my comment to his answer here: I am trying to determine if either $\sigma(n^2) \equiv 1 \pmod 4$ XOR $\sigma(n^2) \equiv 3 \pmod 4$, given that I also know that $4 \nmid \left(\sigma(n) - 2\right)$. – user11235813 Jun 19 '12 at 23:49
To clarify, so far I have: $\sigma(n^2) \equiv (-1)^c \pmod 4$, where $c$ is the number of $i$'s such that $1 \le i \le r$, for prime(s) $p_i \equiv 1 \pmod 4$ and the corresponding exponent(s) $\alpha_i$ is/are odd. – user11235813 Jun 19 '12 at 23:57

If $p \equiv 1\pmod{4}$, then $\sigma (p^{2 \alpha}) = 1 + p + p^2 + \cdots + p^{2 \alpha} \equiv (2 \alpha + 1)\pmod{4} \equiv (-1)^{\alpha}\pmod{4}$, since each term is $1 \pmod{4}$.

If $p \equiv 3\pmod{4}$, then $\sigma (p^{2 \alpha}) = 1 + p + p^2 + \cdots + p^{2 \alpha} \equiv 1\pmod{4}$, since $$1 + p + p^2 + \cdots + p^{2 \alpha} = 1 + p(1+p) + p^3(1+p) + p^5(1+p) + \cdots + p^{2 \alpha-1}(1+p)$$ and $1+p \equiv 0 \pmod{4}$.

Hence, $$\sigma(n^2) = \prod_{p_i-\text{primes of the form 4k+1}} (-1)^{\alpha_i} \pmod{4}$$

Hence, if $\displaystyle \alpha = \sum_{i} \alpha_i$ where $\alpha_i$ is the highest power of prime $p_i$ of the form $4k+1$ dividing $n$, then $$\sigma(n^2) = (-1)^{\alpha} \pmod{4}$$

What sort of improvement are you looking at?

-
I am trying to determine if either $\sigma(n^2) \equiv 1 \pmod 4$ XOR $\sigma(n^2) \equiv 3 \pmod 4$, given that I also know that $4 \nmid \left(\sigma(n) - 2\right)$. – user11235813 Jun 19 '12 at 23:46
@ArnieDris $\alpha = 1 \implies (-1)^{\alpha} = -1$ and where did I say that $(p+1) \vert \sigma(p^{2 \alpha})$? – user17762 Jun 19 '12 at 23:56
Oops sorry, got confused. Yes you're right. How do I delete these comments? :( – user11235813 Jun 20 '12 at 0:04
@ArnieDris No problem. I just wanted to point it out. – user17762 Jun 20 '12 at 0:06
@ArnieDris Yes $\pmod{4}$. It was a typo. – user17762 Jun 20 '12 at 0:36