Arrange the positive integers into a triangular array as shown in the left diagram. Then, following the given rules, take out the odd numbers in even rows and the even numbers in odd rows to obtain the triangular array shown in the right diagram.
Next, arrange the numbers from the right diagram in ascending order to form a sequence {an}. If an=2011, then what is the value of n?
12345678910 11 12 13 14 15 1617 18 19 20 21 22 23 24 2526 27 28 29 30 31 32 33 34 35 36⋯⟶124579101214161719212325262830323436⋯