Count Binary Palindromic Numbers
Build binary palindromes by length from their first half; the palindromes of each length are ordered, so each length is counted by binary search.
Build binary palindromes by length from their first half; the palindromes of each length are ordered, so each length is counted by binary search.