Moser-de Bruijn Sequence
In this problem, you are given an integer input n. Now you need to print the first n elements of the Moser-de Bruijn Sequence. Example 7 0, 1, 4, 5, 16, 17, 20 Explanation The output sequence has the first seven elements of the Moser-de Bruijn Sequence. Thus the output …