Some sequences of bits (3)

Write a program that prints the number of sequences made up of exactly z
zeros and u ones that are multiple of three when considered as a binary
number. Note that numbers that begin with one or more zeros are allowed
here.

For instance, there are 9 sequences for z = 2 and u = 4:
001111  011011  011110  100111  101101  110011  110110  111001  111100

Input

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

Output

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

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:33:55.763Z

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