0

I have this problem of

$$ \sqrt{1+2+3+4+\ldots+n}=m $$

where both n and m are whole positive numbers . I am asked to find the lowest and second lowest possible n that fulfills the equation apart from 0 and 1.

I have rewritten the sum as $1+2+3+4+\ldots+n = n(n+1)/2$ to obtain

$$ n(n+1)/2=m^2 $$

I get stuck at this stage. I have tried defining $j=2m^2$ to get the simplest possible quadratic equation, but with no luck:

$$ n^2+n-j=0 $$

The answers are 8 and 49, but I need to show this.

Any good ideas or inspiration?

Fudzter
  • 19
  • 1
    The question you asked can be re-formulated as: When is a number $N$ both a triangular number and a square ( at the same time of course ). There should be a list online somewhere. Have a look at this site: https://en.wikipedia.org/wiki/Square_triangular_number and here a list from the OEIS. https://oeis.org/search?q=triangular+numbers+that+are+square&go=Search – user25406 Sep 21 '23 at 15:22

1 Answers1

1

We can use

If $n_1,n_2$ are relatively prime positive integers such that $n_1n_2$ is a square, then each of $n_1,n_2$ individually are squares.

along with the fact $\gcd(n,n+1)=1$ and $n(n+1)/2=m^2$ to break the problem into two cases:

  • $n=2k^2$, in which case we must test whether $n+1=2k^2+1$ is a perfect square.
  • $n+1=2k^2$, in which case we must test whether $n=2k^2-1$ is a perfect square.

For $k=0,1$ we only have $n=0,1$, which we're ignoring. For $k=2$ we have $2k^2\pm 1 = 7,9$, which has a square with $9$. For $k=3,4$, we have $17,19,31,33$, which all fail. Then for $k=5$, we have $49,51$, which gives us $49$.

Walking back through the steps gives $n=8, 49$, which are the answers you were wanting.

Perhaps there's a way to find a more direct test, but this one certainly works.