Hello everyone,
I need some help understanding the solution of a problem. The problem is, find the number of ways to represent a number. For example, 4 can be represented in 8 ways: 4, 1+3, 3+1, 2+1+1, 1+2+1, 1+1+2, 2+2, 1+1+1+1
After some calculation I found that, answer of this problem is f(n) = 2^(n-1). e.g.
f(1)=1
f(2)=2
f(3)=4
f(4)=8
f(5)=16
can anyone explain why the answer is 2^(n-1) ? Thanks in advance!