Skip to main content
deleted 43 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43

Jelly, 40 3231 bytes

1SÆD>Ðḟ½ƊṀṭƲ³¡Äż$Ḷ:Ḃ^þ`ʋ/€Ṛṛ""€ḷ""/Y

Try it online!Try it online!

  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 replacing the top-left section of the next board with the new, smallerexisting board.
Ṛ      | Reverse list
    /  | Reduce using the following:
 ṛ""ḷ""   | - Replace the top left portion of the currentnext matrix with the nextcurrent one
     Y | Finally join by newlines

Jelly, 40 32 bytes

1SÆD>Ðḟ½ƊṀṭƲ³¡Äż$Ḷ:Ḃ^þ`ʋ/€Ṛṛ""/Y

Try it online!

  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 replacing the top-left section of the board with the new, smaller board.
Ṛ      | Reverse list
    /  | Reduce using the following:
 ṛ""   | - Replace the top left portion of the current matrix with the next one
     Y | Finally join by newlines

Jelly, 40 31 bytes

1SÆD>Ðḟ½ƊṀṭƲ³¡Äż$Ḷ:Ḃ^þ`ʋ/€ḷ""/Y

Try it online!

  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 through the list of checkerboards, each time replacing the top-left section of the next board with the existing board.
   /  | Reduce using the following:
ḷ""   | - Replace the top left portion of the next matrix with the current one
    Y | Finally join by newlines
deleted 8 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43

Jelly, 40 3332 bytes

1SÆD>Ðḟ½ƊṀ;@Ʋ³¡Äż$Ḷ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 the values

Jelly, 40 33 bytes

1SÆD>Ðḟ½ƊṀ;@Ʋ³¡Äż$Ḷ:Ḃ^þ`ʋ/€Ṛṛ""/Y

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 the values

Jelly, 40 32 bytes

1SÆD>Ðḟ½ƊṀṭƲ³¡Äż$Ḷ:Ḃ^þ`ʋ/€Ṛṛ""/Y

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 the values
added 92 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43

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

Jelly, 40 34 bytes

1SÆD>Ðḟ½ƊṀ;@Ʋ³¡żÄ$Ø.xṁ^þ`ʋ/€Ṛṛ""/Y

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 values of k with their cumulative sum
       ʋ/€ | 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

Jelly, 40 33 bytes

1SÆD>Ðḟ½ƊṀ;@Ʋ³¡Äż$Ḷ:Ḃ^þ`ʋ/€Ṛṛ""/Y

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 the values
      ʋ/€ | 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 k as the right (e.g. 15, 3)
Ḷ         | - Lowered range [0, 1 ... , 13, 14]
 :        | - Integer division by k [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
     | - Mod 2 [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0]
   ^þ`    | - Outer product using xor function and same argument to both side
deleted 3 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43
Loading
deleted 622 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43
Loading
added 2201 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43
Loading
added 80 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43
Loading
added 7 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43
Loading
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43
Loading