题目169 :考察一个数表示成2的幂之和的不同方式
Exploring the number of different ways a number can be expressed as a sum of powers of 2Define f(0)=1 and f(n) to be the number of different ways n can be expressed as a sum of integer powers of 2 using each power no more than twice.
For example, f(10)=5 since there are five different ways to express 10:
1 + 1 + 8
1 + 1 + 4 + 4
1 + 1 + 2 + 2 + 4
2 + 4 + 4
2 + 8
What is f(1025)?
题目:
定义f(0)=1,而 f(n) 则为 数字 n 的表示成 2 的幂之和的方式个数,并且 2 的每个幂次使用不能超过两次。
比如,f(10)=5,因为有以下五种方式来表示 10:
1 + 1 + 8
1 + 1 + 4 + 4
1 + 1 + 2 + 2 + 4
2 + 4 + 4
2 + 8
请问 f(1025) 是多少?
页:
[1]