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

05AB1E, 88 7 bytes

vyLN+èOˆεL¾+èO¼

Try it online!Try it online!

Explanation

ε        # apply to each element x of the input
 L       # push range [1 ... x]
  ¾+     # add counter to each (initially 0)
    è    # cyclically index into input with each
     O   # sum
      ¼  # increment counter

05AB1E, 8 bytes

vyLN+èOˆ

Try it online!

05AB1E, 8 7 bytes

εL¾+èO¼

Try it online!

Explanation

ε        # apply to each element x of the input
 L       # push range [1 ... x]
  ¾+     # add counter to each (initially 0)
    è    # cyclically index into input with each
     O   # sum
      ¼  # increment counter
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

05AB1E, 8 bytes

vyLN+èOˆ

Try it online!