how to formulate arithmetic sequence?