Adding a print statement should help. If you want to store more than one value, a list is usually the container of choice.
## can also be done with list comprehension
print [ a1 * (r ** x) for x in range(n)]
while n > 0:
n = n - 1 ## if 'n' was 1 it is now zero
an = a1 * (r ** n)
print n, "returning", an