Register to reply

Add the numbers from 1 to 100

by _Mayday_
Tags: numbers
Share this thread:
_Mayday_
#1
Feb1-08, 12:22 PM
P: 816
Hey, I've been trying to work this out for a few days now. There is supposed to be an easy way to add all the numbers from 1 to 100 easily, anyone know?
Phys.Org News Partner Science news on Phys.org
Fungus deadly to AIDS patients found to grow on trees
Canola genome sequence reveals evolutionary 'love triangle'
Scientists uncover clues to role of magnetism in iron-based superconductors
Werg22
#2
Feb1-08, 12:37 PM
P: 1,520
I would venture to say that almost anyone on this forum knows how to sum an arithmetic progression. But here's a tip that doesn't call on much more than arithmetic. Consider adding the numbers from 1 to 100 twice. By cleverly arranging the addition like so

1 + 2 + 3 + 4 .... + 100 +
100 + 99 + 98 + 97 ... + 1

what constant relationship do you see between two numbers of the same column?
Curvation
#3
Feb1-08, 12:39 PM
P: 9
I think that the easy way is:

1+2+3+...+100=x (1)
100+99+98+...+1=x (2)

combine this two (1)+(2)

101+101+101+...+101=2x
x=(100*101)/2=5050

_Mayday_
#4
Feb1-08, 12:42 PM
P: 816
Add the numbers from 1 to 100

Brilliant cheers. I thought it had something to do with that but I struggled to put it into a formula.
K.J.Healey
#5
Feb1-08, 07:51 PM
P: 641
I like to match up 100 with 0 myself, and you get all the way down to:
99+1, ... 51+49, then 50. So 100*50 + 50.
country boy
#6
Feb10-08, 02:41 PM
P: 228
There is another way to visualize this using square arrays of elements. In a square array that is m=n+1 elements on a side, the number of off-diagonal elements in the lower left (or upper right) is (m^2-m)/2. But this is also the sum of the number of elements in all of the rows in that part of the matrix: 1+2+3+...+n. In our case n=100, m=101 and (m^2-m)/2=5050. This is equivalent to the Werg22 and Curvation solution.

To get K.J.Healey's solution, note that if we subtract half of the off-diagonal elements (say the upper right) in an nxn array then the remaining number of elements is n^2-(n^2-n)/2=(n^2+n)/2, again the sum of rows is 1+2+3+...+n. But this is n*(n/2)+(n/2) and is equal to 100*50+50 in our case.

Putting m=n+1 into (m^2-m)/2 gives (n^2+n)/2, so the two array visualizations are equivalent, of course.
Alex48674
#7
Feb13-08, 12:28 AM
P: 70
I know how to do this but how would you do it if it weren't just intigers like 1 to n. What if you wanted to add 1+1/n where n = a positive intiger? lets say where n is 1 to 100
a2tha3
#8
Feb21-08, 11:49 PM
P: 33
99+1 98+2 97+3 etc... 100+0 you take half of the number, and multiply it by 100, then add the number (5050)

1000*500+500= 500500 etc.
Schrodinger's Dog
#9
Mar2-08, 03:00 PM
Schrodinger's Dog's Avatar
P: 1,136
Quote Quote by _Mayday_ View Post
Brilliant cheers. I thought it had something to do with that but I struggled to put it into a formula.
It's easy to see why this works if you represent each number as a total of individual numbers.

ie.

100000
110000
111000
111100
111110
111111

And so on, what do you notice about the ratio of 0's to 1's.

Incidentally there's a famous story where Gauss was asked this in a maths class at the age of 7, thinking to stump the children; Gauss gave him an immediate answer, something like the above answers given by the others, by figuring the above simple relation.
ManDay
#10
Mar3-08, 07:13 AM
P: 155
You are all geniuses. Congratulations. I've you had lived about a 120 years ago you would have had developed the normal distribution, perhaps...

Edit: Aw Schroedinger, you were quicker than me. But it's no disgrace to be outran by a genius such as Schroedinger himself.

...or simply by his dog

(just kidding)
kmarinas86
#11
Mar15-08, 01:13 AM
P: 1,011
Quote Quote by _Mayday_ View Post
Hey, I've been trying to work this out for a few days now. There is supposed to be an easy way to add all the numbers from 1 to 100 easily, anyone know?
Sure.

Think of a staircase. The first stair has a height of one. The second stair has a height of two and so on. The stair case forms a rough triangle, whose area is proportional to the square of the stair length. To make a long story short, the simple formula is:

[itex]1+2+3+...+number of stairs=(number of stairs^2+number of stairs)/2[/itex]

[itex]number of stairs = 100[/itex]

[itex](100*100+100)/2[/itex]

[itex]10100/2[/itex]

[itex]5050[/itex]
Einstienear
#12
Mar15-08, 01:16 AM
P: 9
Quote Quote by country boy View Post
There is another way to visualize this using square arrays of elements. In a square array that is m=n+1 elements on a side, the number of off-diagonal elements in the lower left (or upper right) is (m^2-m)/2. But this is also the sum of the number of elements in all of the rows in that part of the matrix: 1+2+3+...+n. In our case n=100, m=101 and (m^2-m)/2=5050. This is equivalent to the Werg22 and Curvation solution.

To get K.J.Healey's solution, note that if we subtract half of the off-diagonal elements (say the upper right) in an nxn array then the remaining number of elements is n^2-(n^2-n)/2=(n^2+n)/2, again the sum of rows is 1+2+3+...+n. But this is n*(n/2)+(n/2) and is equal to 100*50+50 in our case.

Putting m=n+1 into (m^2-m)/2 gives (n^2+n)/2, so the two array visualizations are equivalent, of course.

Ime sure the poster to the thread said "easy".

Not that its hard or anything, but considering the amount of words the poster put in this post, the poster wants an easy solution

(relativity)

Einstienear
NightGale
#13
Mar21-08, 08:13 AM
P: 1
Consider using arithmetic progression's formula:

n/2(a+n) where a is the 1st term = 1, and n is the number of terms = 100
Air
#14
Mar21-08, 12:16 PM
P: 206
1+100=101, 2+99=101, 3+98=101 etc. There are 50 pairs of these so it is 101 times 50 which equals 5050.
Gokul43201
#15
Mar21-08, 05:57 PM
Emeritus
Sci Advisor
PF Gold
Gokul43201's Avatar
P: 11,155
Quote Quote by Alex48674 View Post
I know how to do this but how would you do it if it weren't just intigers like 1 to n. What if you wanted to add 1+1/n where n = a positive intiger? lets say where n is 1 to 100
[tex]\sum_{n=1}^{100}1+\frac{1}{n}=\sum_{n=1}^{100}1+\sum_{n=1}^{100}\frac{1 }{n}[/tex]
[tex]~~~~~=100+ \sum_{n=1}^{100}\frac{1}{n}[/tex]
The remaining term above is a partial sum of a harmonic series. There is no simple, closed-form expression for such a partial sum to arbitrary number of terms. I think there are "compact expressions" for small partial sums and approximations for large ones, but that's all.
Werg22
#16
Apr2-08, 12:01 PM
P: 1,520
An interesting consequence of being able to write down a formula for the sum of the first n naturals: we can write down a formula for the sum of the first n powers m, where m is any natural. To do so, we simply write

[tex] \sum_{k=0}^{n-1} (k+1)^{m+1}=\sum_{k=0}^{n} k^{m+1} [/tex]

then


[tex] \sum_{k=0}^{n-1} (k+1)^{m+1} - k^{m+1} = n^{m+1} [/tex]

Of course, on the left, after a binomial expansion of the first term, we get rid of k^(m+1), left with with the sum of terms with the highest degree being m. So, if we know the formulas for the sums for the powers 1 to m-1, we determine the formula for m.

Of course, it's not very good-looking as you go up... but it's still interesting.
Werg22
#17
Apr2-08, 12:06 PM
P: 1,520
Quote Quote by Gokul43201 View Post
[tex]\sum_{n=1}^{100}1+\frac{1}{n}=\sum_{n=1}^{100}1+\sum_{n=1}^{100}\frac{1 }{n}[/tex]
[tex]~~~~~=100+ \sum_{n=1}^{100}\frac{1}{n}[/tex]
The remaining term above is a partial sum of a harmonic series. There is no simple, closed-form expression for such a partial sum to arbitrary number of terms. I think there are "compact expressions" for small partial sums and approximations for large ones, but that's all.
There's also the approximation [tex]log(100) + {\gamma}[/tex]

With [tex]{\gamma} = 0.577215665...[/tex]

I wonder if it's possible to measure the order of magnitude of the error.
BryanP
#18
Apr2-08, 12:19 PM
P: 205
Just think about the series/sequence. I remember learning about this in an introductory calculus class when we started learning about sequences and series. From there, you can generate formulas such as these.


Register to reply

Related Discussions
Irrational numbers vs. Transcendental numbers General Math 10
A new set of numbers as a z-Axis to imaginary and real numbers? General Math 9
Line of real numbers-transcendental numbers General Math 11
Irrational numbers depends on rational numbers existence General Math 0