- Iterations
- 1

def on_square(n):
"""
Return number of grains on square number n (1-based)
"""
return 2**(n-1)
def total_after(n):
"""
Return total number of grains after n squares
"""
return 2**n - 1

- Iterations
- 1

def on_square(n):
"""
Return number of grains on square number n (1-based)
"""
return 2**(n-1)
def total_after(n):
"""
Return total number of grains after n squares
"""
return 2**n - 1

## Comments

You're not logged in right now. Please login via GitHub to comment