PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
n=int(input())
sequence=[1, 10, 100, 101]
s_element=100
while len(sequence)<=n:
j=0
s_element*=10
sequence.append(s_element)
new_element=str(s_element+sequence[j])
while new_element[1]!='1' and len(sequence)<=n:
j+=1
sequence.append(int(new_element))
new_element=str(s_element+sequence[j])
print(sequence[n-1])
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run