What is most efficient way to find the sum of the series: (N/2^2)*2^2+(N/3^2)*3^2+(N/4^2)*4^2+........

54 Views Asked by At

I have been given a series: $$\lfloor(N/2^2)\rfloor*2^2+\lfloor(N/3^2)\rfloor*3^2+\lfloor(N/4^2)\rfloor*4^2+....+\lfloor(N/\lfloor\sqrt(N)\rfloor^2)\rfloor*\lfloor\sqrt(N)\rfloor^2$$ Where N is a natural number. I know it can be solved in $O({\sqrt N})$ time complexity, but can there be any other way to solve this.