Odd Catalan numbers

The famous Catalan numbers can be defined by the recurrence Cn=i=0n1CiCni1,C_n = \sum_{i=0}^{n-1} C_i \cdot C_{n-i-1} \enspace , with C0=1C_0 = 1. The first Catalan numbers are 1, 1, 2, 5, 14, 42, 132, …

You are given an index ii. What is the smallest jj such that jij \ge i and CjC_j is odd?

Input

Input consists of several cases, each with a natural number no larger than 101510^{15}.

Output

For every ii, print the smallest jj such that jij \ge i and CjC_j is odd. If such a number does not exist, print “Catalans are strange!”.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:52:06.136Z

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