...

/

Sum of Integers from 1 to n

Sum of Integers from 1 to n

In this lesson, we will learn how to find the sum of numbers from 1 to n using recursion.

What does the sum of integers from 1 to nn mean?

Natural numbers are all positive numbers starting with 11. These can be written as follows:

1,2,3,4,5,6,7,8,9,10......1,2,3,4,5,6,7,8,9,10......

We want to write a program that takes a specific number and adds all the numbers from 11 until that number.

For example, if n=5n = 5, the sum of numbers from 11 to 55 ...

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy