Given an integer \$ n \ge 2 \$, you need to calculate \$ \lfloor n \log_2(n) \rfloor \$, assuming all integers in your language are unbounded.
However, you may not ignore floating-point errors - for example, in python lambda n:int(n*math.log2(n))
is an invalid solution, because for example for n=10**15
, int(n*math.log2(n))
is 49828921423310432, while the actual answer is 49828921423310435.
Rules
- You can assume the input is an integer \$ n \ge 2 \$
- You may use any reasonable I/O method
- Standard loopholes are disallowed
Test cases
2 -> 2
3 -> 4
4 -> 8
5 -> 11
6 -> 15
7 -> 19
8 -> 24
9 -> 28
10 -> 33
100 -> 664
1000 -> 9965
10000 -> 132877
10 brownie points for beating my 4 byte 05AB1E answer.
This is code golf, so the shortest answer wins. Good luck!