I made a program that checks how high you can make a pyramid from a number of bricks. Hope it helps :
blocks = int(input("Enter the number of blocks: "))
height = int(0)
layer = int(0)
while(blocks > layer):
layer += 1
blocks = blocks - layer
height += 1
print(height)