fork(3) download
  1. def count(n):
  2. def rec_count(acc, cur_n):
  3. if cur_n > n: return 0
  4. return acc + rec_count((acc+2)**2, cur_n+1)
  5. return rec_count(1, 1)
  6.  
  7. print(count(1))
  8. print(count(2))
  9. print(count(3))
Success #stdin #stdout 0.03s 9984KB
stdin
Standard input is empty
stdout
1
10
131