def count(n):
def rec_count(acc, cur_n):
if cur_n > n: return 0
return acc + rec_count((acc+2)**2, cur_n+1)
return rec_count(1, 1)
print(count(1))
print(count(2))
print(count(3))
ZGVmIGNvdW50KG4pOgoJZGVmIHJlY19jb3VudChhY2MsIGN1cl9uKToKCQlpZiBjdXJfbiA+IG46IHJldHVybiAwCgkJcmV0dXJuIGFjYyArIHJlY19jb3VudCgoYWNjKzIpKioyLCBjdXJfbisxKQoJcmV0dXJuIHJlY19jb3VudCgxLCAxKQoJCnByaW50KGNvdW50KDEpKQpwcmludChjb3VudCgyKSkKcHJpbnQoY291bnQoMykp