Imagine I have two stacks (just called them stack_one and stack_two), each stack have numerous of sticks stacking each other.
The first stack (stack_one), have configuration of stacking sticks like this, the first stick has height 1 unit, on top of first stick, the second stick has height 3 unit, on top of second stick, the third stick has height 5 unit, on top of third stick, the fourth stick has height 7 unit, on top of it fifth stick has height 9, the sixth stick has height 11 unit, and so on....
The second stack (stack_two), have configuration of stacking sticks like this, the first stick has height 29 unit, on top of first stick, the second stick has height 1503 unit ,on top of second stick, the third stick has height 1505 unit (+2 from second stick) ,on top of third stick, the fourth stick has height 1507 unit (+4 from second stick) ,on top of fourth stick, the fifth stick has height 1509 unit (+6 from second stick) ,on top of fifth stick, the sixth stick has height 1511 unit (+8 from second stick) ,the seventh stick has height 1513 unit (+10 from second stick), and so on .......
From that configuration, the question is how many sticks you need to stack in stack_one and stack_two, so that both of them have the same height?.
the thing I can analyze further from that question is , stack_one and stack_two can be written as series
Stack_one > 1, 3 ,5 ,7 ,9 , 11,...
Stack_two > 29, 1503, 1505, 1507, 1509, 1511,...
and therefore I can write the height of the stack_one given the nth stick of stack_one
$$HeightStackOne(n) = n^2$$
and I can write the height of the stack_two given the nth stick of stack_two
$$HeightStackTwo(n) = n^2+1500n-1472$$
And I have found the answer, you need to stack until the 232th stick in stack_one, and you need to stack until the 36th stick in stack_two, but I found that answer with trial and testing.
Is there any other method than trial and testing to solve that question? If you know, please let me know.
So, the problem reduces to finding positive integers $m,n$ such that $$n^2=m^2+1500m-1472$$ We complete the square: $$n^2=(m+750)^2-750^2-1472=r^2-563972$$ where $r=m+750$. So it becomes a question of writing $563972$ as a difference of two squares, $r^2-n^2=563972$.
So, we digress to discuss how, given an integer $c$, we find $r,n$ such that $r^2-n^2=c$. If $c=pq$ with $p,q$ integers of equal parity (that is, both even, or both odd), then $$c=\left({p+q\over2}\right)^2-\left({p-q\over2}\right)^2$$ and conversely if $c=r^2-n^2$ then there exist $p,q$ integers of equal parity such that $c=pq$, $r=(p+q)/2$, and $n=(p-q)/2$.
So, we have to factor $563972$. Well, $563972=2\times2\times277\times509$ is the factorization into primes. Taking $p=2\times509=1018$, $q=2\times277=554$, we get $r=786$, $n=232$, so $m=r-750=36$, the solution OP found by trial and testing.
But there is another answer, since there is another factorization. We can take $p=2\times277\times509=281986$, $q=2$; then $r=140994$, $n=140992$, and $m=140244$, a solution which would take considerably more trial and testing to find.