You are viewing a single comment's thread. Return to all comments →
This is a telescoping series: https://en.wikipedia.org/wiki/Telescoping_series
Accordingly,
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 →
This is a telescoping series: https://en.wikipedia.org/wiki/Telescoping_series
Accordingly,