In how many ways can you represent a number as a sum of 1’s and 2’s?
Some examples:
Number | Different Ways | Total ways |
3 | 1+1+1, 2+1, 1+2 | 3 |
4 | 1+1+1+1, 2+2, 1+1+2, 2+1+1, 1+2+1 | 5 |
Note that sums written in different orders are considered different.
2+1 and 1+2 are considered different combinations.
Submit your answer for the following numbers. How many ways can you write them as a sum of 1’s and 2’s? Do you see a pattern emerge?
[…] about this problem. Or what could be the possible variations to this problem. You can also try this problem where you need to represent any number as sum of 1’s and […]