The sum of c consecutive positive integers = c^2.

Example, c=5: 3+4+5+6+7 = 25 ; 5^2 = 25

(last integer = 7)

If c = 9999, what is the last integer?

What is the last integer in terms of c?

Printable View

- Apr 10th 2012, 05:40 PMWilmerConsecutive integers...
The sum of c consecutive positive integers = c^2.

Example, c=5: 3+4+5+6+7 = 25 ; 5^2 = 25

(last integer = 7)

If c = 9999, what is the last integer?

What is the last integer in terms of c? - Apr 10th 2012, 09:04 PMprincepsRe: Consecutive integers...Code:
`c:=9999:`

for n from 1 to 10000 do

if sum(k,k=n..n+c-1)=c^2 then

print(n+c-1);

break;

end if;

end do;

in terms of $\displaystyle c$ , last integer =$\displaystyle \frac{3c-1}{2}$ - Apr 11th 2012, 02:29 AMWilmerRe: Consecutive integers...
Good one Princeps.

Accidentally got that while fooling around with consecutive numbers.

Had you seen the "easy formula" last integer = (3c - 1)/2 before?

Amazing that there is a solution for ALL odd c's. - Apr 11th 2012, 02:50 AMprincepsRe: Consecutive integers...
$\displaystyle a_i=\frac{c-1}{2}+i ~\text{ for }~ 1\leq i \leq c$

$\displaystyle \displaystyle \sum_{i=1}^c \left(\frac{c-1}{2}+i\right)=c\cdot\frac{(c-1)}{2}+\displaystyle \sum_{i=1}^c i=\frac{c(c-1)}{2}+\frac{c(c+1)}{2}=c^2$