# [Jelly], <s>40</s> 34 bytes 1SÆD>Ðḟ½ƊṀ;@Ʋ³¡żÄ$Ø.xṁ^þ`ʋ/€Ṛṛ""/Y [Try it online!][TIO-jvtozowq] [Jelly]: https://github.com/DennisMitchell/jelly [TIO-jvtozowq]: https://tio.run/##AUYAuf9qZWxsef//MVPDhkQ@w5DhuJ/CvcaK4bmAO0DGssKzwqHFvMOEJMOYLnjhuYFew75gyosv4oKs4bma4bmbIiIvWf///zE1 "Jelly – Try It Online" A full program taking the zero-indexed \$S-1\$ as input and writing to stdout ASCII art using 0 = #, 1 = +. Without the trailing `Y`, this returns a list of lists of integers, but this is out of spec for this challenge. ### Explanation This program works in three stages. 1. Generate a list of values of \$k\$ and the cumulative sum of \$k\$ 2. Generate a checkerboard for each of these with the tile size of \$k\$ and the board size of the cumulative sum 3. Work backwards through the list of checkerboards, each time zeroing out the smaller section of the board that’s about to be filled in. L **Stage 1** 1 | Start with 1 Ʋ³¡ | Loop through the following the number of times indicated by the first argument to the program; this generates a list of values of k S | - Sum Ɗ | - Following three links as a monad ÆD | - List of divisors >Ðḟ½ | - Exclude those greater than the square root Ṁ | - Maximum ;@ | - Concatenate this to the end of the current list of values of k żÄ$ | Zip the values of k with their cumulative sum **Stage 2** ʋ/€ | For each pair of k and cumulative sum, call the following as a dyad with k as the left argument and the cumulative sum as the right Ø.x | - Repeat [0, 1] each k times (e.g. [0, 0, 0, 1, 1, 1] if k is 3 ṁ | - Mould to the length of the cumulative sum ^þ` | - Outer product using xor function and same argument to both side **Stage 3** Ṛ | Reverse list / | Reduce using the following: ṛ"" | - Replace the top left portion of the current matrix with the next one Y | Finally join by newlines