summaryrefslogtreecommitdiff
path: root/progs/a137.py
blob: ff0d66720e5be5a9876025b8f7d23860abd78af8 (plain)
1
2
3
4
5
def geometric_sum(n):
  if n < 0:
    return 0
  else:
    return 1 / (pow(2, n)) + geometric_sum(n - 1)