In the sequence {an}, A1 is equal to 3, a (n + 1) is equal to a * a (n) + 1-A (a is not equal to 0), find a (n) and Sn

In the sequence {an}, A1 is equal to 3, a (n + 1) is equal to a * a (n) + 1-A (a is not equal to 0), find a (n) and Sn

By: a (n + 1) equals a * a (n) + 1-A (a is not equal to 0)
It is concluded that: [a (n + 1) - 1] / [a (n) - 1] = a
That is, the sequence a (n) - 1 is an equal ratio sequence with the first term A1-1 = 2 and the common ratio a
If a = 1, then: sequence a (n) is a constant sequence of 3
That is, a (n) = 3, Sn = 3N
If a is not equal to 1
Then: a (n) - 1 = (A1 - 1) * a ^ (n-1)
That is, a (n) = 2 * a ^ (n-1) + 1
Sn=(a1 -1)(1- a^(n) )/(1-a)
That is, Sn = 2 * (1-A ^ (n)) / (1-A)