Series

HackerRank: Summing the N series

HackerRank: Summing the N series

Finally a problem where we need a little bit of math to solve it. It is called Summing the N series, and when I say a little bit, I mean only a little bit. The problem reads

You are given a sequence whose n^{th} term is

 T_n = n^2 - (n - 1)^2

You have to evaluate the series

 S_n = T_1 + T_2 + T_3 + \cdots + T_n

Find S_n mod (10^9 + 7).

Continue reading →

Posted by Kristian in HackerRank, 1 comment