O(Log(n)) algorithm for counting binary palindromes in a given range