Counting Odd Binomial Coefficients
Time limit1sMemory limit256 MB
Count the pairs (m, k) with m below n whose binomial coefficient is odd.
- Level
Medium7 of 10
- Topics
- Number theory, Bit manipulation, Recursion, Combinatorics
- Solved
- No attempts yet
Problem
For non-negative integers and with , the binomial coefficient is defined as . Let be the number of pairs with such that is odd. The following inequality holds.
Emma does not like an inequality that only brackets the answer, so she wants the exact value of . Help her compute it.
Input
The first line contains one integer ().
Output
Print the value of on the first line.