2
$\begingroup$

I was able to derive the formula for summing consecutive integers:

sum $= \dfrac{n(n + 1)}{2} \Longrightarrow n = 4$, sum $= 10$

Nothing difficult there, but then I would like a formula for giving me the length/end point of an arithmetic sequence, starting with $1$, for a known sum of that sequence. I have tried, but my algebra skills are very rusty.

I have so far, for a sum of $10$, this:

$n^2 + n = 20$

What is the formula for finding the length of, or end point of, an arithmetic sequence, given the sum? If the sum is $10$, I would like the formula to return $4$. If the sum is $561$, then it should return $33$.

Thank you.

$\endgroup$
1
$\begingroup$

The equation has to be rearranged. Let X the sum. The equation is

$X=\frac{n\cdot (n+1)}{2} \quad | \cdot 2$

$2X=n^2+n \quad | -2X$

$ \color{red}1n^2+\color{red}1n\color{red}{-2X}=0$

Solving for n. Applying the quadratic formula for solving a quadratic equation.

The values for the parameters are: $a=1$, $b=1$ and $c=-2X$

$n_{1/2}=\frac{-1\pm \sqrt{1-4\cdot (-2X)}}{2}=\frac{-1\pm \sqrt{1+4\cdot 2X}}{2}$

You need only the positive value.

Thus $n_1=\boxed{n=\frac{-1+ \sqrt{1+8X}}{2}}$

$\endgroup$
  • $\begingroup$ Thank you. I cannot up vote, as not enough rep., but I appreciate the answer, but also the point in the direction of the quadratic formula. I am vaguely familiar with it, but will be more so by tomorrow. Thanks again. $\endgroup$ – JayJay123 Jun 8 '15 at 2:24
  • $\begingroup$ @JayJay123 You are welcome. I colored the values of the parameters a, b and c. I hope it helps. $\endgroup$ – callculus Jun 8 '15 at 2:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.