General rule :
Let the number be : 1234567890123.... with "n" digits. Here it is a repetative pattern of m=10 digits.
The general answer to this puzzle is 2^k (mod m) such that n >= 2^k > n/2 (>= is greater or equal).
For this particular puzzle n=4000 and m=10. Then value of k such that 4000 >= 2^k > 4000/2 is k=11 , 2^k =2048 and answer is 2048(mod 10) = 8.