How to add integers from 1 to N

Author: Ellen Moore
Date Of Creation: 17 January 2021
Update Date: 29 June 2024
Anonim
Adding and Subtracting Integers Using a Simple Method
Video: Adding and Subtracting Integers Using a Simple Method

Content

If you're preparing for a test or just want to learn how to quickly add numbers, remember how to add integers from 1 to n{ displaystyle n}... Since you are going to add integers, you don't have to worry about fractions (common and decimal). Just decide which formula to use. Then substitute the given integer instead of n{ displaystyle n} and find the answer.


Steps

Method 1 of 2: How to work with a sequence

  1. 1 Determine the arithmetic sequence. Look at the row of numbers you want to add. To use a formula to sum integers, make sure that a series of numbers is indeed a sequence, that is, each number increases by the same amount.
    • For example, a row of numbers 5, 6, 7, 8, 9 is a sequence, just like a row of 17, 19, 21, 23, 25.
    • The row of numbers 5, 6, 9, 11, 14 is not a sequence, because the numbers increase by different amounts.
  2. 2 Define n{ displaystyle n} sequence. To use a formula to sum integers from 1 to n{ displaystyle n}, determine the largest integer that you substitute for n{ displaystyle n}.
    • For example, if you want to add all integers from 1 to 100, n{ displaystyle n} = 100 because it is the largest integer in the sequence.
    • Remember you are working with integers, so n{ displaystyle n} cannot be a fraction (common or decimal) or a negative number.
  3. 3 Find the number of integers to add. To sum integers from seed to n{ displaystyle n}, you need to find the total number of added numbers. For example, if you want to add whole numbers from 1 to 200, the total number of numbers is calculated like this: 200 + 1 = 201.
    • For example, if you need to find the sum of integers from 1 to 12, the number of numbers is 12 + 1 = 13.
  4. 4 Find the sum of integers between two whole numbers that are not included in the calculation. In this case, subtract 1 from n{ displaystyle n}.
    • For example, to find the sum of integers between 1 and 100, subtract 1 from 100 to get 99.

Method 2 of 2: How to use a formula to add integers

  1. 1 Write down a formula for calculating the sum of consecutive integers. Now that you have identified n{ displaystyle n} (the largest number to add), plug it into the formula to add consecutive integers: Sum = n{ displaystyle n}*(n{ displaystyle n}+1)/2.
    • For example, to add whole numbers from 1 to 100, substitute 100 for n{ displaystyle n}: 100*(100+1)/2.
    • To add integers from 1 to 20, instead of n{ displaystyle n} substitute 20: 20 * (20 + 1) / 2 = 420/2 = 210.
  2. 2 Write down a formula for calculating the sum of even integers. If you want to find the sum of even integers in a sequence that starts with 1, you need to use a different formula.Substitute the largest integer for n{ displaystyle n} into the following formula: Sum = n{ displaystyle n}∗(n{ displaystyle n}+2)/4.
    • For example, if you need to find the sum of even numbers from 1 to 20, substitute 20 for n{ displaystyle n}: 20*22/4.
  3. 3 Write down a formula for calculating the sum of odd integers. If you want to find the sum of odd integers, you first need to find n{ displaystyle n}... To do this, add 1 to the largest number in the sequence. Then use the following formula: Sum = (n{ displaystyle n}+1)*(n{ displaystyle n}+1)/4.
    • For example, to add odd integers from 1 to 9, add 1 to 9. The formula would be 10 * (10) / 4 = 100/4 = 25.
  4. 4 Use the formulas provided to find the amount. When you have substituted the number you need in the formula, multiply it by yourself, add 1, 2 or 4 (depending on the formula), and then divide the result by 2 or 4.
    • Example 1: 100 * 101/2 = 10100/2 = 5050.
    • Example 2 (with even numbers): 20 * 22/4 = 440/4 = 110.