8th test

Try to tell what logic is used here:

1=1

2=2

3=3

4=3

5=2

6=3

7=4

8=5

9=3

10=2