Jelly, 40 3433 bytes
1SÆD>Ðḟ½ƊṀ;@Ʋ³¡żÄ$Ø.xṁ^þ`ʋ1SÆD>Ðḟ½ƊṀ;@Ʋ³¡Äż$Ḷ:Ḃ^þ`ʋ/€Ṛṛ""/Y
Try it online!Try it online!
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 cumulative sum of the values of k with their cumulativethe sumvalues
ʋ/€ | For each pair of k and cumulative sum, call the following as a dyad with the cumulative sum of k as the left argument and the cumulative sumk as the right
Ø (e.xg. 15, 3)
Ḷ | - RepeatLowered range [0, 1]1 each... k, times13, (e.g.14]
: | - Integer division by k [0, 0, 0, 1, 1, 1]1, if2, k2, is2, 3
, 3, 3, ṁ4, 4, 4]
Ḃ | - MouldMod 2 to[0, the0, length0, of1, the1, cumulative1, sum
0, 0, 0, 1, 1, 1, 0, 0, 0]
^þ` | - Outer product using xor function and same argument to both side