Question: Please create this exercise using matlab When Gauss was 10 years old, his teacher wanted some quiet time, and asked his students to add up
Please create this exercise using matlab
When Gauss was 10 years old, his teacher wanted some quiet time, and asked his students to add up all the natural numbers from 1 to 100. In a few moments, Gauss got the solution. He realized that by making pairs of numbers (first with last, second with second to last,...) one always obtains the same sum, 101, and since there are 50 pairs, the result is 101 x 50 = 5050. In effect, S= n(n+1)/2, where n is the final number. Use this expression to calculate the result of the sum.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
