This is a slightly slower but simpler recursive process to calculate all the 1430 valid pyramid-flags values.