Geometric progression 1,q,q2,q3,…\text{Geometric progression } 1, q, q^2, q^3, \ldots

Sum =a(1−rn)1−r\text{Sum } = \frac{a(1 - r^n)}{1 - r}

Arithmetic progression a,a+d,a+2d,…\text{Arithmetic progression } a, a+d, a+2d, \ldots

Sum =n2(a1+an)=n2[2a+(n−1)d]\text{Sum } = \frac{n}{2}(a_{1} + a_{n}) = \frac{n}{2}[2a + (n - 1)d]

Linear recurrence relation

Linear recurrence relation of order k is of the form: \text{Linear recurrence relation of order } k \text{ is of the form: }

an=c1an−1+c2an−2+…+ckan−k+da_n = c_{1}a_{n-1} + c_{2}a_{n-2} + \ldots + c_{k}a_{n-k} + d

If d=0, the relation is homogenous.\text{If } d=0\text{, the relation is homogenous.}

Finding the explicit form of an means expressing anwithout any of its previous terms.\text{Finding the explicit form of } a_n \text{ means expressing } a_n \text {without any of its previous terms.}

Backtracking

Replacing each term with its previous terms and try to find patterns.

Characteristic equation

Homogenous

For homogeneous linear rr:

an=c1an−1+c2an−1+…+ckan−ka_n = c_{1}a_{n-1} + c_{2}a_{n-1} + \ldots + c_{k}a_{n-k}

xk=c1xk−1+c2xk−2+…+ckx^k = c_{1}x^{k-1} + c_{2}x^{k-2}+ \ldots + c_k

For root x1 with multiplicity 1 and root x2 with multiplicity 2:\text{For root } x_{1} \text{ with multiplicity } 1 \text{ and root } x_{2} \text{ with multiplicity 2:}

an=u1⋅x1n+u2⋅x2n+u3⋅n⋅x2na_n = u_{1} \cdot x_{1}^n + u_{2} \cdot x_{2}^n + u_{3} \cdot n \cdot x_{2}^n

Non-homogenous

Exponential constant

Solve the linear recurrence relation an=3an−1−2an−2+3n.\text{Solve the linear recurrence relation } a_n = 3a_{n-1} - 2a_{n-2} + 3^n.

Polynomial constant

Solve the linear recurrence relation an=3an−1−2an−2+3n+1.\text{Solve the linear recurrence relation } a_n = 3a_{n-1} - 2a_{n-2} + 3n + 1.

Deriving recurrence relation

Let an be the number of decimal strings of length n,\text{Let } a_n \text{ be the number of decimal strings of length } n,

that do not contain the substring ′2025′.\text{that do not contain the substring } '2025'.

Find the recurrence relation for an.\text{Find the recurrence relation for }a_n.

Let an be the number of ternary {0,1,2} strings of length n,\text{Let } a_n \text{ be the number of ternary } \{0, 1, 2\} \text{ strings of length } n,

that do not contain the substring ′222′.\text{that do not contain the substring } '222'.

Find the recurrence relation for an.\text{Find the recurrence relation for }a_n.

Let an be the number of DNA {A,T,C,G} sequences of length n,\text{Let } a_n \text{ be the number of DNA } \{A, T, C, G\} \text{ sequences of length } n,

that do not contain the substring ‘TATAT’.

Find the recurrence relation for an.\text{Find the recurrence relation for }a_n.