-2
$\begingroup$

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 
$\endgroup$
1
  • $\begingroup$ I wouldn't suggest migration to math.stackexchange without first checking to see whether it would be a duplicate there (I suspect it would). $\endgroup$ Commented Oct 25, 2021 at 0:05

1 Answer 1

0
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ The notation $\sigma(m)$ generally denotes the sum, not the number, of divisors. For the number, most use $d(m)$ or $\tau(m)$. $\endgroup$ Commented Oct 25, 2021 at 0:02
  • $\begingroup$ Also, everything works for odd prime values of $m$, starting from $m=m\times1$. $\endgroup$ Commented Oct 25, 2021 at 0:03

Not the answer you're looking for? Browse other questions tagged .