In a geometric sequence, if a3 = ‒5 and a6 = 40, determine a1, r, and an. Then write the first three terms of the sequence.