Advertisement
mrlolthe1st

Untitled

Sep 2nd, 2021
972
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. from math import sqrt,floor
  2. n=int(input())
  3. i = 1
  4. ans = 0
  5. while i * i <= n:
  6.     z = (n // (i * i))
  7.     l = floor(sqrt(n // z))
  8.     ans += z * (l - i + 1)
  9.     i = l + 1
  10. print(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement