I have a formula for decoding a 3-bit data object: $$T = 68 + 2 \sum_{i=0}^22^iTempA_i$$ where $TempA$ is the 3-bit object and $TempA_i$ is the $i$'th bit from the right.
I am trying to rewrite this as a formula for $TempA_i$ and I understand how to do this with a C program (I'm a a programmer, not a mathematician) but I can't determine if it is possible to write a non-conditional formula for this. I believe I need to use the modulus operator to achieve the formula, but I haven't had any luck yet.
A formula for each digit:
$Temp{A_0}=\dfrac{T-68}{2}\bmod2$
$Temp{A_1}=\big\lfloor\dfrac{T-68}{4}\big\rfloor\bmod2$
$Temp{A_2}=\big\lfloor\dfrac{T-68}{8}\big\rfloor\bmod2$
The general formula is:
$Temp{A_i}=\big\lfloor\dfrac{T-68}{2^{i+1}}\big\rfloor\bmod2$
In C, a simple integer-division can be used instead of the $\big\lfloor\dots\big\rfloor$:
As suggested in one of the comments below, bit-wise operations can be used instead: