def tn_ap(a,n,d): tn = a + (n - 1) * d return tn