i have an infinite sequence starting with 0, 1, 2

then each member goes twice: 0, 0, 1, 1

then each member goes three times, then four times and so on.

i described my sequence and you are to find a repeating pattern in the given infinite sequence

only then write python function to get n-th member of this sequence, with input n,

you are not allowed to include lists in function i need, exept the following list: [0, 1, 2]