The transfer function (in Z-transform) of a first order low-pass filter is TF = kz^-1/(1-(1-k)z^-1) in which 1/k is the time constant. Using a time constant of 2^n, TF = (1/2^n)/(z-(2^n-1)/2^n).

Let x(k) and y(k) be the input and the output.

y(z)/x(z) = (1/2^n)/(z-(2^n-1)/2^n)
(z-(2^n-1)/2^n)y(z)=(1/2^n)x(z)
y(z)=((2^n-1)/2^n)(z^-1)y(z)+(1/2^n)(z^-1)x(z)

Take the inverse Z-transform

y(k)=((2^n-1)/2^n)y(k-1)+(1/2^n)x(k-1)

When n = 3

y(k)=y(k-1)-y(k-1)/8+x(k-1)/8

Equivalently

y(k+1)=y(k)-y(k)/8+x(k)/8