Read this knowing that I have no mathematics background whatsoever.
I was solving a specific programming problem that required knowledge of Pythagorean triplets, which is something that I hadn't really worked with before. Anyway, I'm curious if there is an existing proof for this:
The Wikipedia article on Pythagorean triplet functions states that for any positive integer greater than $a = 3$, triplets can be generated with the following formulas:
If a is odd: $b = \frac{a^2}{2} - \frac{1}{2}$ and $c = b + 1$
If b is even: $b = \frac{a^2}{4} - 1$ and $c = b + 2$
However, in looking at the output of a Pythagorean triplet generator I created in Ruby, I noticed a pattern which seemed to say that the above functions actually point to a more generic one:
For any positive integer $a$, where $p$ is any prime factor of $a$ greater than $2$:
$b = \frac{a^2}{2(\frac{a}{p})} - \frac{\frac{a}{p}}{2}$ and $c = b + \frac{a}{p}$
For example, let's say that $a=99$ and that $p=11$.
$b = \frac{99^2}{2(\frac{99}{11})} - \frac{\frac{99}{11}}{2} = 540$ $c = 540 + \frac{99}{11} = 549$
Finally:
$99^2 + 540^2 = 549^2$
Or with the prime number $a=48611$ and $p=48611$, you end up with:
$48611^2 + 1181514660^2 = 1181514661^2$
This would also imply that for any base $a$, there are at least the same number of Pythagorean triplets that there are of prime factors of $a$ greater than 2, and that likewise, any prime number can be the $a$ of only a single pythagorean triplet.
Edit
As @ThomasAndrews pointed out and I realized, $p$ need not be prime.