I want to find the sum of something that goes like:

Sum(x) = x + (x-1) + (x-2)... etc.

so that Sum(3) = 3 + 2 + 1 = 6

Is there a fast way to do this for situations where x is kind of big? (i.e. x=100)

- Thread starter fireyice
- Start date

I want to find the sum of something that goes like:

Sum(x) = x + (x-1) + (x-2)... etc.

so that Sum(3) = 3 + 2 + 1 = 6

Is there a fast way to do this for situations where x is kind of big? (i.e. x=100)

Let x=100, then we have 100+(100-1)+(100-2)+................+(100-99)

Which is the same as 100+99+98+............+1

The formula for summing integers from 1 up to some x value is \(\displaystyle \frac{x(x+1)}{2}\)

If x=100, the we have 5050.

If we add all the integers from 1 to 100, they sum to 5050.

Try it with 1 million.

- Joined
- Oct 6, 2005

- Messages
- 10,251

If so, then here's some other ways to write it:fireyice said:Is there any to write that besides x(x+1)/2 ?

Are you trying to ask: "Is there any other way to write that?"

\(\displaystyle \frac{x^2}{2} \;+\; \frac{x}{2}\)

\(\displaystyle \frac{x}{2} \;\cdot\; (x + 1)\)

\(\displaystyle \frac{x^2 + x}{2}\)

If not, then please rephrase your question.

This is simply an arithmetic progression with a first term of x, a last term of (x-2) and a common difference of -1.fireyice said:

I want to find the sum of something that goes like:

Sum(x) = x + (x-1) + (x-2)... etc.

so that Sum(3) = 3 + 2 + 1 = 6

Is there a fast way to do this for situations where x is kind of big? (i.e. x=100)

The sum of an arithmetic progression derives from Sn = n(a + L)/2 where a = the first term x, L = the last term (x-2) and n = the number of terms.

Therefore, the sum of a sequence of numbers defined by x + (x-1) + (x-2)...etc. is S(n) = n(x + x - (n - 1))/2 = n(2x - n + 1)/2.

Some other number summations you might find interesting.

1--The sum of the first n positive integers, 1+2+3+.....+n, is n(n + 1)/2 or n(n + 1)/2.

The sum of n consecutive integers from a to b is given by

....................S = [b(b + 1) - a(a - 1)]/2 or

....................S = [b^2 + b - a^2 + a]/2 or

....................S = [(a + b)(b - a + 1)]/2

2--The sum of the first n positive even integers, 2+4+6+.....+n, = n(n + 1).

3--The sum of the first n positive odd integers, 1+3+5+.....+ (2n-1), is equal to n^2.

(To find n^2, add up all the odd numbers up to and including 2n - 1.)

4--The sum of the squares of the first n integers is 1^2+2^2+3^2+.....+n^2, is n(n+1)(2n+1)/6.

5--The sum of the first n integers cubed, 1^3+2^3+3^3+.....+(2n-1)^3 = (1+2+3+.....+(2n-1))^2 = [(n^2 + n)/2]^2 or

The sum of the first n cubes is equal to the square of the nth triangular number.

Sn^3 = Tn^2

n..........1....2....3.....4.....5......6......7......8

...n^3.......1....8...27...64..125...216..343...512

S(n^2)....1...9...36..100..225...441..784..1296

..Tn.........1...3....6....10....15....21....28.....36

Tn^2......1...9...36...100..225..441..784..1296

6--The sum of a finite arithmetic series/progression is given by S = n(a + L)/2.

Numbers are said to be in arithmetic progression when they increase or decrease by a common difference, as in a, (a + d), (a + 2d), (a + 3d), --------(a + nd), d being the common difference.

The last, or nth, term of an arithmetic progression is L = a + (n - d)d where a is the first term, d is the common difference, and n is the number of terms.

7--The sum of a finite geometric series/progression is given by S = a[(r^n) - 1]/(r - 1).

Numbers are said to be in geometric progression when they increase or decrease by a constant factor as in a, ar, ar^2, ar^3,........ar^n. The constant factor is also called the common ratio.

The last term of a geometric progression is given by L = ar^(n - 1) where a is the first term, r is the common f factor, and n is the number of terms.

8--The sum of the harmonic series 1 + 1/2 + 1/3 + 1/4 +...........1/n is defined by Sn = ln(n) + .577215664901, the number .577215664901.......being Euler's constant.

Three quantities are said to be in harmonic progression when a/c = (a - b)/(b - c). Any number of quantities

are said to be in harmonic progression when every three consecutive terms are in harmonic progression.

The reciprocals of quantities in harmonic progression are in arithmetic progression. If a, b, and c are in

harmonic progression, i.e., a/c = (a - b)/(b - c), a(b - c) = c(a - b). Dividing every term by abc yields 1/c - 1/b =

1/b - 1/a, thus proving the proposition.

The sequence of terms derived from the reciprocals of an arithmetic progression form a harmonic progression as in 1, 1/2, 1/3, 1/4, ...........1/n. Problems in harmonic progressions are sometimes solved by inverting the terms, and treating the result as an arithmetic progression. The harmonic mean of three quantities in harmonic progression is the middle term. The harmonic mean between two quantities is given by Hm = 2ab/(a + b).

9--The sum of the series 1(1!) + 2(2!) + 3(3!) + 4(4!) + ..........n(n!) = Sn = (n + 1)! - 1.

10--For any number -1 < r < +1, the limit of 1 + r + r^2 + r^3 + r^4 + ...... is 1/(1 - r)

If the sum ended at r^k, the sum up to that point would be 1 + r + r^2 + r^3 + .+ r^k = (1 - r^(k+1))/(1 - r).

11--The limit of the sum of 1 + 1/n + 1/n^2 + 1/n^3 + .............= 2 - 1/2^(n-1).

12--n^3 is always the sum of n odd integers beginning with (n^2 - n + 1) and ending with (n^2 + n - 1).

13--1x2 + 2x3 + 3x4 +............+ n(n+1) = n(n+1)(n+2)/3.

14--1/1x2 + 1/2x3 + 1/3x4 + ..............1/n(n+1) = n/(n+1)

15--* 1/n = 1/(n+1) + 1/n(n+1)

16-- The nth term of the series 1 + 2 + 4 + 8 + 16 + .........= 2^(n-1).

17--The sum of the first n terms of the series 1 + 2 + 4 + 8 + 16 + ......, or 1, 3, 7, 15, ----- is 2^n - 1.

18--The sum of the first n cubes is equal to the square of the nth triangular number or S(n^3) = Tn^2 = [n(n-

1)/2]^2.

19--The sum of the first n terms of the series 1 + x + x^2 + x^3 + ------x^(n-1) = (x^n - 1)/(x - 1).

20--The sum of the first n terms of the series 1 + x + x^2 + x^3 + ------x^k = (x^(k+1) - 1)/(x - 1).

21--1^3 + 2^3 + 3^3 + 4^3 + -----n^3 = (1 + 2 + 3 + 4 + -----n)^2 = [n(n + 1)/2]^2.

22--The sum of the first n terms of the series 1 + x + x^2 + x^3 + ------x^(n-1) = (x^n - 1)/(x - 1).

23--The sum of (n + 1) consecutive squares, beginning with the square of n(2n + 1), is equal to the sum of the squares of the next n consecutive squares, e.g., for n = 1, 3^2 + 4^2 = 5^2; for n = 2, 10^2 + 11^2 + 12^2 = 13^2 + 14^2; etc.

24--The successive sums of the squares of the digits in a number will ultimately result in a 1 or a 4 followed by a repeating series of numbers.

Example: Given 8429. 8^2 + 4^2 + 2^2 + 9^2 = 165. 1^2 + 6^2 + 5^2 = 62. 6^2 + 2^2 = 40. 4^2 + 0^2 = 16. 1^2 + 6^2 = 37. 3^2 + 7^2 = 58. 5^2 + 8^2 = 89. 8^2 + 9^2 = 145. 1^2 + 4^2 + 5^2 = 42. 4^2 + 2^2 = 20. 2^2 + 0^2 = 4. 4^2 = 16 > 37 > 58 > 89 > 145 > 42 > 20 > 4 ad infinatum.

25--Finding a set of "n" consecutive numbers that total a given sum "N", given "n" and "N".

Sets of n consecutive numbers.

If both n and N are odd, N/n produces the middle number of the n numbers which is an odd number.

If n is odd and N is even, N/n produces the middle number of the n numbers which is an even number.

If both n and N are even, and N/n produces an even number, there is no solution.

If both n and N are even, and N/n ends in .5 (x.5), the middle two numbers of the n numbers are (x.5 - .5) and (x.5 + .5).

If n ts n is even and N is odd, there is no solution.

Sets of n consecutive even numbers:

N is obviously even.

If n is even, there are N/n numbers on both sides of N/n.

If n is odd, N/n isi the middle number of the n numbers.

Sets of n odd consecutive numbers:

If N/n is even, therre are N/n numbers on both sides of N/n.

If N/n is odd, N/n is the middle number of the n numbers.

26--Finding a set of "n" consecutive numbers that total a given sum "N", given only "N".

The sum of the consecutive numbers from "a" to "b", is given by N = b(b + 1)/2 - a(a - 1)/2 "a" and "b" being the first and last numbers of the consecutive group.

In terms of the number of numbers to be added, we need solutions to N = [(x + (n-1))(x + n)]/2 - x(x - 1)/2 where n = the total number of numbers and x = the first number.

Expanding and simplifying, we get x = [2N - n(n - 1)]/2n = N/n - (n - 1)/2.

The problem becomes one of finding integer values of "n" that result in integer values of "x".

Example:

What 25 consecutive numbers add up to 101,075?

In most cases, there will probably be more than one set of consecutive integers that add up to given total, N.

For this particular problem, it is obvious that "n" must be a multiple of 5.

We can now ask ourselves, what factors/divisors of 101,075 end in 5?

The prime factorization of 101,075 is 5x5x13x311 = 5^2(13^1)311^1.

The total number of factors of 101,075 is therefore f(N) = (2 + 1)(1 + 1)(1 + 1) = 12 namely, 1, 5, 13, 25, 65, 311, 325, 1555, 4043, 7775, 20215 and 101,075.

Therefore, there are 7 possible numbers that evenly divide into 101,075.

n.........................5...........25..........65..........325..........1555.....7775.....20215

x.....................20,213.....4031.......1523........149..........-712....-3874....-10102

x + (n - 1).........20,217.....4055.......1587........473.............x.........x...........x

.

Thus, we have 4 groups of consecutive numbers that sum to 101,075.

Another way of attacking it is that the sum of 25 consecutive numbers, the smallest of which is "x", derives from (x + 24)(x + 25)/2 - x(x - 1)/2 = 101,075

Expanding, x^2 = 49x + 600 - x^2 + x = 202,150.

Enjoy

- Joined
- Jun 18, 2007

- Messages
- 18,134

What is IKD?

I hope the student is not misspelling abbreviation!!!

I hope the student is not misspelling abbreviation!!!

- Joined
- Oct 6, 2005

- Messages
- 10,251

Subhotosh Khan said:What is IKD?

I Know Diddly :lol: