find all fancy pairs of (a,b)
Source: STEMS 2024, CAT A, P1
December 17, 2023
combinatorics
Problem Statement
Let be a positive integer and . We call a pair of non-negative integers fancy if is in and is a palindrome in binary. Find the number of fancy pairs .