General solution
A. Let (n+1) represent a triangular number (we shall return to this later).
1. Suma = (n+1) to (n+m) a^2, equivalently 1/6m(2m^2+6 mn+3m+6n^2+6n+1)
2. Sumb = (n+m+1) to (n+2m-1) b^2, equivalently 1/6(m-1) (14m^2+18 mn-m+6 n^2)
I 1/6m(2m^2+6 mn+3m+6n^2+6n+1) = 1/6(m-1) (14m^2+18 mn-m+6 n^2) Simplifying massively:
II {n = -m}, {n = m(2m-3)}
The triangular number was 1 more than n, so we take
I m(2m-3)+1
II 2m^2-3m+1 Expanding
III (m-1) (2m-1) Factoring
IV (2m-2)(2m-1) Doubling the first factor
Now we have the product of 2 successive integers. But a triangular number is 1/2(n)(n+1), so doubling that also, (2m-2)(2m-1) = (n)(n+1) and since 2m-1 exceeds 2m-2, n+1 = 2m-1 and so n = 2(m-1); m = (n/2)+1. Hence, as assumed, m(2m-3)+1 is an even-indexed triangular number, and includes all such numbers. Correspondingly, m(2m-3)+2m, the first number after the end of the second sequence, is an odd-indexed triangular number, and includes all such numbers also.
To summarise, if we want the sum of m consecutive squares starting with A to equal the sum of the next (m-1) consecutive squares, then we select A = m(2m-3)+1 as the first square to start with, for m squares, then the next (m-1) squares.
B. The first number in the first series is always of the form n(2n+1), see A014105 in Sloane (obvious from the identity n=(m-1), when (m-1)(2(m-1)+1) = m(2m-3) +1), while the first number in the second series is always of the form 2n(n+1)+1, see A001844 in Sloane (using the same substitution, n=m-1: 2(m-1)((m-1)+1)+1 = 2m^2-2m+1; while also m(2m-3)+m+1 = 2m^2-2m+1, confirming the identity).
Deploying these: Suma=(2m^2+m) to (2m^2+2m) a^2, Sumb= (2m^2+2m+1) to (2m^2+3m) b^2:
Suma = 1/6m(m+1)(24m^3+36m^2+14m+1)
Sumb = 1/6m(24m^4+60m^3+50m^2+15m+1)
Cancel 1/6m in both and expand the first equation: 24m^4+60m^3+50m^2+15m+1; and the two are the same, as expected.
C. Hence a full description of the general solution is now in reach.
Select any number, n, as the length of the first series, and deduct 1 from it to find m:
1. The first series of squares starts with 2m^2+m, and ends with 2m^2+2m, inclusive.
2. The second series of squares starts with 2m^2+2m+1 and ends with (2m^2+3m)
3. The equation 1/6(m)(m+1)(2m+1)(12m^2+12m+1) gives the two corresponding sums of squares.
4. The index of triangular number 2m^2+m is 2m. Hence if the index is known, simply divide it by 2 to find m. |