These are top-heavy pyramids. The blue one has 21 at the apex (top) and the red one has 31.

blue pyramid: bottom row - 4, 5, 7; next row - 9, 12; top - 21. Red pyramid: bottom row - 3, 7, 1, 4; next row - 10, 8, 5; next row - 18, 13; top - 31.

A pair of numbers are added to make the number above that pair.

In the blue top-heavy pyramid whose base is 4 5 7, 4 + 5 = 9, so the 9 is placed between and above the 4 and the 5.
5 + 7 = 12 and 9 + 12 = 21.

Use the numbers in the box below to make the base of a top-heavy pyramid whose apex is 200.

numbers 1, 3, 4, 8, 9, 12