Just 1’s and 2’s

In how many ways can you represent a number as a sum of 1’s and 2’s?

Some examples:

NumberDifferent WaysTotal ways
31+1+1, 2+1, 1+23
41+1+1+1, 2+2, 1+1+2, 2+1+1, 1+2+15

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?

guest
86 Comments
Inline Feedbacks
View all comments

[…] 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 […]