Formulate recurrence from sequence (#721)

Formulate recurrence from sequence (#721)

Express ana_n in terms of previous terms based on problem conditions.