<p>答案已经公布了?我做了好长时间也不知对不对,顺便看答案</p><p>=(A2-LOOKUP(A2,(2-ISEVEN(A2))*3^(ROW($1:$5)+ISEVEN(A2))+1))*1.5+2</p><p>Function LastOne(Number As Integer) As Integer<br/> Dim arr() As Boolean<br/> Dim i As Integer<br/> Dim iCountFalse As Integer, iCountTrue As Integer<br/> <br/> ReDim arr(1 To Number) As Boolean</p><p> i = 1: LastOne = 1: iCountTrue = 0: iCountFalse = 1<br/> Do While Number >= iCountTrue + iCountFalse<br/> If Not arr(i) Then<br/> iCountFalse = iCountFalse + 1<br/> If iCountFalse Mod 3 > 0 Then<br/> arr(i) = True<br/> Else<br/> LastOne = i<br/> iCountTrue = 0<br/> iCountFalse = 0<br/> End If<br/> <br/> Else<br/> iCountTrue = iCountTrue + 1<br/> End If<br/> i = (i Mod Number) + 1<br/> Loop<br/>End Function</p>