Recursive formula for arithmetic sequences