What are pyramidal sequences? How do they work, and can I have some examples of ones? What are their recursive and explicit formulas, and how do solve them with and without knowing the number of layers?

For context, I was faced with a problem earlier. The issue with it is that I knew how many balls were in the pyramid(300) but not how many layers, I had no clue how to solve it.

the problem goes as such:

As a project for his high school's science fair, Miguel wants to construct a stack of ping-pong balls in the shape of an ancient pyramid. For a budget of $30, he can purchase 300 balls. how many layers are in the tallest pyramid he can build?(He will have some balls left over.)​