Problem 43179. Red and green towers
Frankie has a large number of wooden cubes, painted in red and green. He is building little towers with his cubes, by stacking them on top of each other.
He got bored after a while, so he introduced a rule: two red cubes may not be touching (see image).

Given n (the maximum number of cubes in a tower), determine the number m of different towers that Frankie can build.
Example: for n = 2, he can make 5 towers, so m=5:
- [Red];
- [Green];
- [Red, Green];
- [Green, Red];
- [Green, Green].
You may assume that the input is an integer greater than zero.
Solution Stats
Problem Comments
Solution Comments
Show commentsGroup

Combinatorics III
- 22 Problems
- 12 Finishers
- What can you get for exactly amount of money(harder)
- Highest powers in factorials
- Exponents in Factorials
- Kurchan Square - Evaluation Function
- Kurchan 3x3 - Optimal Score
- Kurchan 4x4 - Optimal score
- Kurchan 5x5 - Optimal Score
- Factorial: Unlimited Size : java.math
- Lowest sum from a group of digits
- Create all combinations of vectors
- Full combinations
- So many choices
- Factorizing a number into a given number of factors
- Addition Partition
- Find the inverse permutation
- Red and green towers
- Maximum sum from any 2 numbers with a variable number of inputs
- Sleeping Queens 1
- Recycled Numbers (CodeJam Qualification Round 2012)
- Sum of combinations
- Penny Flipping: Reverse subsets of a sequence of coins until you recover the original configuration
- Penny Distribution Machine
Problem Recent Solvers23
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!