vector_of_powers function

Computes elements A^n until the given size