Finding common difference and calculating specific terms