CAICE - Editorial

PROBLEM LINK:

Practice

Contest

Author: rahul_ojha_07

Tester: horsbug98

DIFFICULTY:

EASY

PREREQUISITES:

Modulo Operation, Basic Mathematics

PROBLEM:

Given the First and Second number of a series, you have to find the Nth number of the series.

QUICK EXPLANATION:

Nth number of the series can be found using the formula n*(n+1) ÷ 2

EXPLANATION:

The 1st element of the series is 1 and the 2nd element of the series is 3.
lets find the 3rd number using the given formula in the question.

Bi =(Bi-1 + Bi+1 - 1) ÷ 2

As we know the 1st and 2nd element of the series so for getting the 3rd element of the series we have to change the equation a little bit,

Now,By changing the equation we get,

Bi+1 =(2Bi - Bi-1 + 1)

Now to get the 3rd element of the series putting i=2,
we get B3 = 6.
We can see the Series following a pattern here i.e.

      For i=1 -> B1 = 1
      For i=2 -> B2 = 3
      For i=3 -> B3 = 6
This is the pattern for sum of i Natural numbers. We can clearly see that for i=1 S1 = 1

for i=2 S2 = 1 + 2 = 3

for i=3 S3 = 1 + 2 + 3 = 6.

and so on

We can further verify this by the concept of mathematical induction.
So, As the series follows the sum of natural numbers so we can get the sum up to ith terms by the following formula

Note:The Series of number 1 3 6… is also known as Triangular numbers

Author’s solution can be found here.

1 Like
//