You are viewing a single comment's thread. Return to all comments →
No closed form equation is known, as discussed in A061418.
For fun, here's a bitwise solution:
m = 2 tot = 2 for _ in range(1, input()): m += m>>1 tot += m print tot
Here's how it works:
Method taken from here
Seems like cookies are disabled on this browser, please enable them to open this website
Viral Advertising
You are viewing a single comment's thread. Return to all comments →
No closed form equation is known, as discussed in A061418.
For fun, here's a bitwise solution:
Here's how it works:
Method taken from here