# How to find the positive integer solution?

The question askes the sum of $$1$$ to $$n$$ and a number $$i$$ which $$1\le i \le n$$ is equal to 1986

Which means $$\frac{n(n+1)}{2}=1986-i$$ Then how to find the solution algebraically? I get $$i=33,n=62$$ by listing them...

Sorry, It is a stupid question.

We get $$\frac{n(n+1)}{2}<1986, \frac{n(n+1)}{2}>1986-n$$

Which result the only integer $$n=62$$ satisfies the equation...

• Most questions look easy after you've figured out the solution :P – Simply Beautiful Art Sep 16 '19 at 21:42

You can estimate $$(n+\frac 12)^2=n^2+n+\frac 14 \lt 2\times 1986=3972\approx 3969=63^2$$ so $$n\lt 63$$.

On the other hand $$61\times 62 =3782=3972-190$$ would be too small. So $$n\gt 61$$. There is only one possible integer answer.

You really only need the first of these which shows you that $$62$$ will be close.

Find $$n$$ as the floor of the value you get with the quadratic formula and $$i=0$$. Then $$i$$ is just what's left.

• How to show that $i$ is smaller than n? – yuanming luo Sep 16 '19 at 21:33
• is that true for all equations like this? or was it just luck that it worked by taking the floor of the equation after setting i = 0? – rhavelka Sep 16 '19 at 21:34
• @rhvelka It is true because of $\frac{n(n+1)}{2}$ is increasing function, i is an integer. So what you get is bigger than the answer you want. Then take the floor. Becuase $\frac{n(n+1)}{2}$ is always an integer, so $1986-\frac{n(n+1)}{2}$. The only question is the uniqueness of $i$ – yuanming luo Sep 16 '19 at 21:42