To find the first four terms of the sequence defined by a1=5 and an=3an-1, we can use recursive formula to generate the terms of the sequence.
a1 = 5
a2 = 3a1 = 3(5) = 15
a3 = 3a2 = 3(15) = 45
a4 = 3a3 = 3(45) = 135
Therefore, the first four terms of the sequence are:
5, 15, 45, 135.