It has been awhile, and I know this is very basic, but if someone would help me just get this, I know I can start retraining my brain. Basically it is this. I have :
number of digits x
position of digit y
value of digit z
so, iterating through the digits (from left to right) I want to add the product of each value and 2^y-1.
Not sure how clear the question is. I can almost see the equation in my mind, but it has been so long.
Thanks.