Created a function to compute the length of a list
Created function to compute x ^ i