Skip to main content
added 429 characters in body
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

05AB1E, 17 bytes

FLN+I·¸«ˆ}·¸I>.׈

Try it online!

Explanation

F                   # for N in [0 ... input-1]
 L                  # push range [1 ... input]
  N+                # add N to each
    I·¸«            # append input*2
        ˆ           # add to global list
         }          # end loop
          ·¸        # push [input*2]
            I>.×    # repeat it input+1 times
                ˆ   # add to global list
                    # implicitly output global list

05AB1E, 17 bytes

FLN+I·¸«ˆ}·¸I>.׈

Try it online!

05AB1E, 17 bytes

FLN+I·¸«ˆ}·¸I>.׈

Try it online!

Explanation

F                   # for N in [0 ... input-1]
 L                  # push range [1 ... input]
  N+                # add N to each
    I·¸«            # append input*2
        ˆ           # add to global list
         }          # end loop
          ·¸        # push [input*2]
            I>.×    # repeat it input+1 times
                ˆ   # add to global list
                    # implicitly output global list
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

05AB1E, 17 bytes

FLN+I·¸«ˆ}·¸I>.׈

Try it online!