Most programming languages have functions for getting bits but I need to do it on a calculator so I need to understand how to do it mathematically. Basically I need a formula for getting the $n$th bit from and integer, $i$.
So given: $i = 6$ and $n = 3$, I would get $1$ because binary for $6$ is $110$.
How might I manage this?
Given $i$ you want to throw away the bottom $n-1$ bits, so integer divide by $2^{n-1}$. Then take $\bmod 2$ to get the low order bit.