Some sequences of bits (1)

Write a program that prints the number of sequences of length n made up
of only zeros and ones that do not contain two consecutive zeros nor
three consecutive ones.

For instance, there are 7 sequences for n = 5:
01010  01011  01101  10101  10110  11010  11011

Input

Input consists of several natural numbers n, each between 0 and 150.

Output

For every n, print the required number.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:55:18.156Z

© Jutge.org, 2006–2026.
https://jutge.org
