Finding the nth term and arithmetic means