You are viewing a single comment's thread. Return to all comments →
Following the arithmatic progression Sn = 1 + 3 + 5 + ...+ 2n-1= (1+2n-1) * n / 2 = n * n So, the code in Python3
def summingSeries(n): return n**2%(10**9+7)
Seems like cookies are disabled on this browser, please enable them to open this website
Summing the N series
You are viewing a single comment's thread. Return to all comments →
Following the arithmatic progression Sn = 1 + 3 + 5 + ...+ 2n-1= (1+2n-1) * n / 2 = n * n So, the code in Python3