#MAX=500000 Dim a.i(#MAX) Dim b.b(1) Dim c.b(1000) FillMemory(@c(),1000,1,#PB_Byte) If OpenConsole() : Else : End 1 : EndIf For n_Count=0 To #MAX If n_Count=0 a(n_Count)=0 ElseIf a(n_Count-1)-n_Count>0 And b(a(n_Count-1)-n_Count)=0 a(n_Count)=a(n_Count-1)-n_Count Else a(n_Count)=a(n_Count-1)+n_Count EndIf If ArraySize(b())