2 of 3 deleted 1 character in body

R, 58 55 bytes

b=seq(a<-scan());while(any(b-a))a=matrix(a,,2,F<-F+1);F

Try it online!

Simulates the sorting process. Input is 1-indexed, returns FALSE for 0.