HMMT 二月 2009 · COMB 赛 · 第 5 题
HMMT February 2009 — COMB Round — Problem 5
题目详情
- [ 4 ] Let s ( n ) denote the number of 1’s in the binary representation of n . Compute ∑ 1 n s ( n ) 2 ( − 1) . 255 0 ≤ n< 16
解析
- [ 4 ] Let s ( n ) denote the number of 1’s in the binary representation of n . Compute ∑ 1 n s ( n ) 2 ( − 1) . 255 0 ≤ n< 16 Answer: 45 ∑ 1 s ( n ) s ( n +8) 8 n s ( n ) Solution: Notice that if n < 8, ( − 1) = ( − 1) · ( − 1) so the sum becomes (1 − 2 ) 2 ( − 1) = 0 ≤ n< 8 255
1