Nokia interview question

Create an algorithm to create a pyramid