• + 1 comment

    I don’t know if this helps with a solution per se, but there is an O(N) way to answer the SE OP’s question and I was hoping you could add this to your answer. Observe that the number of ways to represent a value is (0) keyed to the 2nd LSB and greater (a parity thingy), (1) builds on the previous—i.e. two values before—number of ways by adding 2 to each value, (2) also includes some other previous step by adding a 0 or 1 to the RHS, and (3) if past 9, then excludes parts corresponding to some previous step because digits do not go to hex-like A/B as a result of (1).

    Specifically, (2) refers to half the value and (3) refers to half of 10 less than the value. If I’m counting all this correctly, anyhow.