The number of decompositions of $2n-1$ into a difference of two squares?

105 Views Asked by At

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

Examples:

 3: 1       |       21: 1        |       39: 2      |       57: 1
 4: 1       |       22: 1        |       40: 1      |       58: 2
 5: 2       |       23: 3        |       41: 3      |       59: 3
 6: 1       |       24: 1        |       42: 1      |       60: 2
 7: 1       |       25: 2        |       43: 2      |       61: 2
 8: 2       |       26: 2        |       44: 2      |       62: 2
 9: 1       |       27: 1        |       45: 1      |       63: 2
10: 1       |       28: 2        |       46: 2      |       64: 1
11: 2       |       29: 2        |       47: 2      |       65: 2
12: 1       |       30: 1        |       48: 2      |       66: 1
13: 2       |       31: 1        |       49: 1      |       67: 2
14: 2       |       32: 3        |       50: 3      |       68: 4
15: 1       |       33: 2        |       51: 1      |       69: 1
16: 1       |       34: 1        |       52: 1      |       70: 1
17: 2       |       35: 2        |       53: 4      |       71: 2
18: 2       |       36: 1        |       54: 1      |       72: 2
19: 1       |       37: 1        |       55: 1      |       73: 2
20: 2       |       38: 3        |       56: 2      |       74: 3
1

There are 1 best solutions below

0
On BEST ANSWER

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$$

This is OEIS sequence A193773