Is there a exact formula for number of decompositions of $2n-1$ into a difference of two squares?


Examples:



```
 3: 1       |       21: 1 
 4: 1       |       22: 1 
 5: 2       |       23: 3 
 6: 1       |       24: 1 
 7: 1       |       25: 2 
 8: 2       |       26: 2 
 9: 1       |       27: 1 
10: 1       |       28: 2 
11: 2       |       29: 2 
12: 1       |       30: 1 
13: 2       |       31: 1 
14: 2       |       32: 3 
15: 1       |       33: 2 
16: 1       |       34: 1 
17: 2       |       35: 2 
18: 2       |       36: 1 
19: 1       |       37: 1 
20: 2       |       38: 3 

```


The number of decompositions of $2n-1$ into a difference of two squares?
Any odd composite integer $m$ can be written as $m=pq$. We can switch it to a difference of squares:



> 
> $$m=pq$$
> $$4m=4pq$$
> $$4m=2pq+2pq$$
> $$4m=2pq+2pq+q^{2}-q^{2}+p^{2}-p^{2}$$
> $$4m=\left(p+q\right)^{2}-\left(q-p\right)^{2}$$
> $$m=\frac{\left(p+q\right)^{2}}{4}-\frac{\left(q-p\right)}{4}^{2}$$
> $$m=\left(\frac{p+q}{2}\right)^{2}-\left(\frac{q-p}{2}\right)^{2}$$
> 
> 
> 


Since $m$ is odd, $p$ and $q$ are also odd. Therefore, every possible pairs $p,q$ such that $m=pq$ will be solutions. We can now use the number of divisors function $\sigma(m)$ to conclude that:



> 
> The number of decompositions of $2n-1$ into a difference of two squares is defined by: $$\left\lceil \frac{\sigma\left(2n-1\right)}{2}\right\rceil$$
> 
> 
> 


