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

05AB1E, 21 1919 18 bytes

Input is taken in the order x(1),N(0-based), x(2), x(1).
Saved 1 byte thanks to carusocomputing.

sG©sDŠ®"GUDXsX"/+*-"Nè.V})

Try it online!

Unfortunately © does't work with implicit input, which costs us a byte.Try it online!

Explanation

s                    # swap first 2 inputs
 G                   # for N in [0 ... n-1] do:
  ©U                  # save top element of stack in registerX
   sD                 # swapduplicate top 2 elements of stack
    DX                # duplicate top ofpush stackX
     Šs               # and move itswap downtop 2 positionselements on stack
      ®X              # push from registerX
       "/+*-"Nè      # index into the string with the current iteration number
               .V    # evaluate
                 }   # end loop
                  )  # wrap stack in list

We iteratively build the stack with the latest element in the sequence on top, while keeping all previous elements in order.
Then we wrap the stack in a list at the end to display all values at once.

05AB1E, 21 19 bytes

Input is taken in the order x(1),N(0-based), x(2)

sG©sDŠ®"/+*-"Nè.V})

Try it online!

Unfortunately © does't work with implicit input, which costs us a byte.

Explanation

s                    # swap first 2 inputs
 G                   # for N in [0 ... n-1] do:
  ©                  # save top element of stack in register
   s                 # swap top 2 elements of stack
    D                # duplicate top of stack
     Š               # and move it down 2 positions on stack
      ®              # push from register
       "/+*-"Nè      # index into the string with the current iteration number
               .V    # evaluate
                 }   # end loop
                  )  # wrap stack in list

We iteratively build the stack with the latest element in the sequence on top, while keeping all previous elements in order.
Then we wrap the stack in a list at the end to display all values at once.

05AB1E, 21 19 18 bytes

Input is taken in the order N(0-based), x(2), x(1).
Saved 1 byte thanks to carusocomputing.

GUDXsX"/+*-"Nè.V})

Try it online!

Explanation

 G                   # for N in [0 ... n-1] do:
  U                  # save top element of stack in X
   D                 # duplicate top of stack
    X                # push X
     s               # swap top 2 elements on stack
      X              # push X
       "/+*-"Nè      # index into the string with the current iteration number
               .V    # evaluate
                 }   # end loop
                  )  # wrap stack in list

We iteratively build the stack with the latest element in the sequence on top, while keeping all previous elements in order.
Then we wrap the stack in a list at the end to display all values at once.

added 72 characters in body
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

05AB1E, 21 19 bytes

Input is taken in the order x(1),N(0-based), x(2)

sG©sDŠ®"/+*-"Nè.V})

Try it online!

Unfortunately © does't work with implicit input, which costs us a byte.

Explanation

s                    # swap first 2 inputs
 G                   # for N in [0 ... n-1] do:
  ©                  # save top element of stack in register
   s                 # swap top 2 elements of stack
    D                # duplicate top of stack
     Š               # and move it down 2 positions on stack
      ®              # push from register
       "/+*-"Nè      # index into the string with the current iteration number
               .V    # evaluate
                 }   # end loop
                  )  # wrap stack in list

We iteratively build the stack with the latest element in the sequence on top, while keeping all previous elements in order.
Then we wrap the stack in a list at the end to display all values at once.

05AB1E, 21 19 bytes

Input is taken in the order x(1),N(0-based), x(2)

sG©sDŠ®"/+*-"Nè.V})

Try it online!

Unfortunately © does't work with implicit input, which costs us a byte.

05AB1E, 21 19 bytes

Input is taken in the order x(1),N(0-based), x(2)

sG©sDŠ®"/+*-"Nè.V})

Try it online!

Unfortunately © does't work with implicit input, which costs us a byte.

Explanation

s                    # swap first 2 inputs
 G                   # for N in [0 ... n-1] do:
  ©                  # save top element of stack in register
   s                 # swap top 2 elements of stack
    D                # duplicate top of stack
     Š               # and move it down 2 positions on stack
      ®              # push from register
       "/+*-"Nè      # index into the string with the current iteration number
               .V    # evaluate
                 }   # end loop
                  )  # wrap stack in list

We iteratively build the stack with the latest element in the sequence on top, while keeping all previous elements in order.
Then we wrap the stack in a list at the end to display all values at once.

added 72 characters in body
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

05AB1E, 2121 19 bytes

Input is taken in the order x(1),N(0-based), x(2)

D,ŠD,s<GDŠ"sG©sDŠ®"/+*-"Nè.V=V})

Try it online!Try it online!

Unfortunately © does't work with implicit input, which costs us a byte.

05AB1E, 21 bytes

D,ŠD,s<GDŠ"/+*-"Nè.V=

Try it online!

05AB1E, 21 19 bytes

Input is taken in the order x(1),N(0-based), x(2)

sG©sDŠ®"/+*-"Nè.V})

Try it online!

Unfortunately © does't work with implicit input, which costs us a byte.

Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162
Loading