Advertisement
juxtapositions

Untitled

Nov 22nd, 2021
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. count=0
  2. n=int(input())
  3. def f(n):
  4. if n<=3:
  5. return n
  6. elif n>3 and n%2==0:
  7. return 2*n*n+f(n-1)
  8. else:
  9. return n*n*n+n+f(n-1)
  10.  
  11. for i in range(1,300):
  12. n=i
  13. if f(i)<10**7:
  14. count+=1
  15. print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement