You can shift the number of steps x to the right, and then do bitwise, and the result is 1, to get a bit at position x , do it with a list and get your list. If you need to support negative numbers, we may need to add a null list to the list to ensure that positive numbers do not start with 1:
-21 = [1, 1, 1, 0, 1, 0, 1, 1] 21 = [0, 0, 0, 1, 0, 1, 0, 1] 128 = [0, 1, 0, 0, 0, 0, 0, 0, 0] 255 = [0, 1, 1, 1, 1, 1, 1, 1, 1] 256 = [0, 1, 0, 0, 0, 0, 0, 0, 0, 0] -256 = [1, 0, 0, 0, 0, 0, 0, 0, 0]