Some sequences of bits (2)

Write a program that prints the number of sequences made up of exactly z
zeros and u ones that do not contain two consecutive zeros nor three
consecutive ones.

For instance, there are 8 sequences for z = 3 and u = 4:
0101011  0101101  0110101  0110110  1010101  1010110  1011010  1101010

Input

Input consists of several pairs of natural numbers z and u, each between
0 and 90.

Output

For every pair of z and u, print the required number.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T10:21:21.386Z

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