Возможно, это неправильно.
n=10
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
n=2
1,10,11,100,101,110,111,1000,1001,1010,1011,1100,1101,1110,1111,10000,10001,10010,10011,
10100.
n=3
1,2,10,11,12,20,21,22,100,101,102,110,111,112,120,121,122,200,201,202.
n=5
1,2,3,4,10,11,12,13,14,20,21,22,23,24,30,31,32,33,34,40.
n=8
1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,20,21,22,23,24.