We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
You need not make it that complicated
t(n) = n^2 - (n-1)^2
See the pattern.
Every addition in S(n) we are subtracting the previous term
For better understanding see the inductive approach.
Summing the N series
You are viewing a single comment's thread. Return to all comments →
My python solution
Explanation
You need not make it that complicated t(n) = n^2 - (n-1)^2 See the pattern. Every addition in S(n) we are subtracting the previous term For better understanding see the inductive approach.
So my answer would be
Sn = n^2%1000000007