I came across a problem which goes like this:
You are given n and k where and n, k ≤ 1014. Now you need to find:
![](https://espresso.codeforces.com/3b5d90e136b139446fbe31ed65043891446c7334.png)
Where i is even. In other words, find:
![](https://espresso.codeforces.com/7df3b4ee4c46d4e70b388be46e68b8d723746ecc.png)
Where r ≤ k and r is even.
Some discussion on this problem. So is there a way to solve this problem?