There is the following sequence:
101001000100001...
How to define a method that takes an element's index of the sequence and returns the value (0 or 1) of this element?
public Element getValue(int index) {}
Maybe there's need to use recursion? I would be grateful for any ideas!