Pull requests welcome. Don't hesitate to start a conversation in Discussions.
See Fermat's theorem on sums of two squares, but here for specific case with x and y are consecutive.
See this conversation on SeqFan mailing list.
For any
And also
Start with
0² + 1² = 1,
1² + 2² = 5, 2² + 3² = 13,
3² + 4² = 25, 4² + 5² = 41, 5² + 6² = 61,
6² + 7² = 85, 7² + 8² = 113,
8² + 9² = 145, 9² + 10² = 181, 10² + 11² = 221,
11² + 12² = 265, 12² + 13² = 313,
13² + 14² = 365, 14² + 15² = 421, 15² + 16² = 481,
16² + 17² = 545, 17² + 18² = 613,
18² + 19² = 685, 19² + 20² = 761, 20² + 21² = 841,
21² + 22² = 925, 22² + 23² = 1013,
23² + 24² = 1105, 24² + 25² = 1201, 25² + 26² = 1301,
26² + 27² = 1405, 27² + 28² = 1513,
28² + 29² = 1625, 29² + 30² = 1741, 30² + 31² = 1861,
31² + 32² = 1985, 32² + 33² = 2113,
33² + 34² = 2245, 34² + 35² = 2381, 35² + 36² = 2521,
36² + 37² = 2665, 37² + 38² = 2813,
38² + 39² = 2965, 39² + 40² = 3121, 40² + 41² = 3281,
41² + 42² = 3445, 42² + 43² = 3613,
43² + 44² = 3785, 44² + 45² = 3961, 45² + 46² = 4141,
46² + 47² = 4325, 47² + 48² = 4513,
48² + 49² = 4705, 49² + 50² = 4901, 50² + 51² = 5101, ...
We can observe :
- first column :
-
$s$ multiple of 5, and a Brahmagupta–Fibonacci identity - the gap between values are 20 times of the OEIS A080512 sequence
-
- second column :
- odd lines with
$s$ ending by 13 (at position$5j + 2$ ) - even lines with
$s$ ending by 1 (with gap of$100n + 40$ between them), a cycle ending by$41, 81, 21, 61, 01$
- odd lines with
- third column :
-
$s$ ending by 1 (with gap of$100n + 60$ between them), a cycle ending by$61, 21, 81, 41, 01$ - some square values as
$25, 841, \dots$ with this relation :$x=\frac{\sqrt{8s-4}-2}{4}$
-
For
0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, ...
We observe the terms of OEIS A000217 sequence.
The first column consists of terms that always ending by 5, meaning they are all multiples of 5 (such as
According to the Brahmagupta-Fibonacci identity, the product —or perfect quotient— of two sums of two squares is itself a sum of two squares.
Since 5 can be written as
For example:
$5 / 5 = 1 \implies 0^2 + 1^2$ $25 / 5 = 5 \implies 1^2 + 2^2$ $85 / 5 = 17 \implies 1^2 + 4^2$ $145 / 5 = 29 \implies 2^2 + 5^2$ $265 / 5 = 53 \implies 2^2 + 7^2$ $365 / 5 = 73 \implies 3^2 + 8^2$ $545 / 5 = 109 \implies 3^2 + 10^2$
For the first column (where
For odd-lines, by tracking the resulting pairs
- The values of
$x'$ follow the sequence$k$ (for$k=0, 1, 2, 3 \dots$ ) - The values of
$y'$ follow the sequence$3k + 1$
| x | y | s | s/5 | x′^2+y′^2 | (x′, y′) |
|---|---|---|---|---|---|
| 1 | 2 | 5 | 1 | 0²+1² | (0, 1) |
| 6 | 7 | 85 | 17 | 1²+4² | (1, 4) |
| 11 | 12 | 265 | 53 | 2²+7² | (2, 7) |
| 16 | 17 | 545 | 109 | 3²+10² | (3, 10) |
This proves that every term in the first column is linked to a specific Gaussian integer transition.
Specifically, each sum
The gap between
Actually, no existing OEIS sequence for this polynomial.
In the same way, for even-lines, by tracking the resulting pairs
- The values of
$x'$ follow the sequence$k$ (for$k=0, 1, 2, 3 \dots$ ) - The values of
$y'$ follow the sequence$3k - 1$
Specifically, each sum
The gap between
This is related to the OEIS A087348 sequence.
This confirms that the first column is not just a collection of multiples of 5, but a structured sequence of sums of squares where the base values
This regularity is a direct consequence of the Brahmagupta-Fibonacci identity applied to the prime factor 5.
By observing the equation
First, since
This aligns with the necessary condition in Fermat's theorem on sums of two squares.
Because
A corollary of Fermat's theorem states that if a number can be expressed as the sum of two coprime squares, every single odd prime factor of that number must be congruent to 1 modulo 4 (i.e., of the form
Then for any sum of two consecutive squares ending by 13 (where
This guarantees that these numbers (if not primes) will never be divisible by non Pythagorean primes (such as
All of the prime factors of these s are strictly of the form
The values of
If we isolate the even-line terms from the second column that do not ending by 13 (such as
The sum becomes
The values of
By calculating the difference between consecutive terms in this sub-sequence, we find that the gap grows by exactly
This
-
the 2-digit cycle: Because the difference adds exactly
$40$ to the tens and units digits (modulo 100) at each step, the last two digits of these numbers follow an infinite, repeating 5-step cycle: 41, 81, 21, 61, 01 (and then back to 41) -
triangular number formula: just like the terms ending by 13 can be expressed using triangular numbers (
$100 T_n + 13$ ), we can express this sub-sequence using the$k$ -th triangular number ($T_k$ ) and the term index ($k$ ):$s_k = 100 T_k + 40k + 41$
The third column consists of terms where
If we write
By analyzing the difference between consecutive terms in this column (
This
-
the reversed 2-digit cycle: because the difference adds
$60$ to the tens and units digits (modulo 100) at each step, the last two digits follow an infinite 5-step cycle that is the exact reverse of the second column's cycle: 61, 21, 81, 41, 01 (and then back to 61) -
triangular number formula: we can express this sequence using the
$(k-1)$ -th triangular number ($T_{k-1}$ ):$s_k = 100 T_{k-1} + 60k + 1$
Prime numbers of s values and Bunyakovsky's conjecture
If we expand our initial equation
Note: a known property for this polynomial is 8s − 4 = (4x + 2)², then s is the sum of two consecutive squares if and only if 8s − 4 is a perfect square.
By factoring it, we can rewrite the equation as
This factored form provides proof that
This quadratic polynomial satisfies the three strict conditions of Bunyakovsky's conjecture:
- its leading coefficient is positive (
$2 > 0$ ) - it is irreducible over the integers (it cannot be factored into two linear polynomials with rational coefficients)
- the generated values share no common divisor greater than 1 for all
$x$ (for example, the first two terms, 5 and 13, are strictly coprime)
Because it meets all these criteria, Bunyakovsky's conjecture dictates that this sequence should generate an infinite number of primes.
While this remains one of the unproven problems in mathematics (no one has yet been able to prove that any polynomial of degree 2 or higher generates infinitely many primes), the mathematical structure of
An algebraic analysis reveals an intersection between the first and second columns, showing that they are structurally intertwined.
For the sub-sequence in the first column where
This shared mathematical DNA allows us to deduce two properties:
-
the accumulation rule: the values of
$s/5$ in the first column are directly generated by summing up the sequential base values of the second column. It forms this hybrid identity:$$\frac{s_{col1}(k)}{5} = 1 + 4 \sum_{j=0}^{k-1} x_{col2}(j)$$ - inter-column synergy: the columns in this system are not isolated patterns. The acceleration rate of the first column's growth is strictly governed by the linear progression of the second column's base numbers.
The Daniel's contribution highlighted additional layers of symmetry connecting this sequence to the broader world of triangular numbers.
While we have already established how our specific sums of squares generate triangular patterns, there are further fundamental properties at play.
The relationship flows in both directions: just as our sums are linked to triangular numbers, the sum of any two consecutive triangular numbers forms a perfect square (
If we group specific pairs of sums from our sequence —specifically, the sums of consecutive squares originating from base numbers symmetrically offset around multiples of 5— their combined total yields a clean equation.
For any integer
(For example, with
2. Connection to OEIS A016802 sequence
As a natural extension of how squares and triangular numbers interact, there is a strict rule regarding specific pairs of even triangular numbers.
If we sum
- for
$n=1$ :$T_3 + T_4 = 6 + 10 = 16 \implies 16(1²)$ - for
$n=2$ :$T_7 + T_8 = 28 + 36 = 64 \implies 16(2²)$ - for
$n=3$ :$T_{11} + T_{12} = 66 + 78 = 144 \implies 16(3²)$
This progression (
Occasionally, the sum of two consecutive squares results in a perfect square (
$x=0 \implies 0² + 1² = 1² \implies s=1$ $x=3 \implies 3² + 4² = 5² \implies s=25$ $x=20 \implies 20² + 21² = 29² \implies s=841$ $x=119 \implies 119² + 120² = 169² \implies s=28561$
Note: for
When this occurs, the equation
Through algebraic manipulation, we can rewrite our base equation
By substituting
This is the classic negative Pell's equation. It proves that the values of
Because Pell's equation solutions grow exponentially based on the silver ratio (
When exploring the sequence
Geometrically, this corresponds to finding right-angled triangles with integer sides where the two legs are consecutive integers.
Expanding the initial equation gives:
If we substitute
The solutions to this equation are entirely generated by the Pell number sequences:
- The hypotenuse
$Y = c$ perfectly matches the odd-indexed Pell numbers ($P_k$ ). The Pell sequence is defined by$P_k = 2P_{k-1} + P_{k-2}$ (with$P_0=0, P_1=1$ ). - The term
$X = 2n+1$ matches the odd-indexed Companion Pell numbers (or half-Pell-Lucas numbers,$H_k$ ), defined by$H_k = 2H_{k-1} + H_{k-2}$ (with$H_0=1, H_1=1$ ).
The fundamental structure of the equation
In the context of our consecutive squares, this means that the ratio
|
|
Hypotenuse |
|
Ratio |
Approximation of |
|
|---|---|---|---|---|---|
| 3 | 3 | 5 | 7 | 7 / 5 | 1.400000... |
| 5 | 20 | 29 | 41 | 41 / 29 | 1.413793... |
| 7 | 119 | 169 | 239 | 239 / 169 | 1.414201... |
| 9 | 696 | 985 | 1393 | 1393 / 985 | 1.414213... |
This demonstrates that our geometric search for consecutive integer right triangles is linked to the continuous fraction expansion of
A001333 : 1, 1, 3, 7, 17, 41, 99, 239, 577, 1393, 3363, 8119, 19601, 47321, 114243, 275807, 665857, 1607521, 3880899, 9369319, 22619537, 54608393, 131836323, 318281039, 768398401, 1855077841, 4478554083, 10812186007, 26102926097, 63018038201, 152139002499, 367296043199, ...
A000129 : 0, 1, 2, 5, 12, 29, 70, 169, 408, 985, 2378, 5741, 13860, 33461, 80782, 195025, 470832, 1136689, 2744210, 6625109, 15994428, 38613965, 93222358, 225058681, 543339720, 1311738121, 3166815962, 7645370045, 18457556052, 44560482149, 107578520350, 259717522849, ...