Sum of the first five odd numbers

1 + 3 + 5 + 7 + 9 = 25 = 52

$colors = ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6']; $color_len = count($colors); list($styles, $boxes) = [[], []]; for ($i = 0; $i < $color_len; $i++) { for ($j = 0; $j < $color_len; $j++) { $max_idx = max($i, $j); if($i + $j < 2 * $max_idx + 1) { $boxes[] = "<div class='c{$max_idx}'></div>"; } } $styles[] = ".c{$i} {background-color: {$colors[$i]}}"; } $boxes = implode('', $boxes); $styles = implode('', $styles);