g | x | w | all
Bytes Lang Time Link
034TIBASIC TI83 Plus250515T130552Zmadeforl
038Juby250514T194536ZJordan
016Perl 5 n240203T065716ZXcali
003Vyxal240203T060215Zemanresu
003Uiua SBCS240203T004501Zchunes
008K ngn/k220507T100611Zoeuf
022Factor220507T064041Zchunes
047Desmos220507T061504ZAiden Ch
005MathGolf181007T003319ZJo King
005J181007T080512ZGalen Iv
013dc181012T071133Zeush77
029PowerShell181011T225816ZVeskah
003MATL181006T164828ZGiuseppe
009K oK181010T144252ZThaufeki
040Python 2181010T142025ZSteven H
006Pyth181007T075932ZSteven H
00305AB1E181008T065636ZKevin Cr
002Husk181008T035034ZLeo
039Python 3181007T144912ZQuintec
067Common Lisp181007T083223ZRenzo
003Japt181006T192032ZShaggy
069Batch181007T001418ZNeil
012Charcoal181007T001145ZNeil
047Python 2181006T231716ZChas Bro
032Standard ML181006T222852ZLaikoni
003APLDyalog181006T162043ZQuintec
015R181006T165006ZKirill L
009Perl 6181006T163546Znwellnho
027JavaScript ES6181006T161621ZArnauld
014Wolfram Language Mathematica181006T161452ZMisha La
003Jelly181006T160513ZErik the
008Haskell181006T160448Znimi

TI-BASIC (TI-83 Plus), 34 bytes

Input L₁
For(K,2,dim(L₁
L₁(K-1)L₁(K→L₁(K
End
L₁

type list as {1,2,3,4,5...

input a0 as the first element in the list

J-uby, 38 bytes

:unshift|:*%[:& &(:take|:/&:*),:+@|:+]

Attempt This Online!

Perl 5 -n, 16 bytes

$b||=1;say$b*=$_

Try it online!

Vyxal, 3 bytes

pɖ*

Try it Online!

p   # Prepend
 ɖ* # Cumulative product

Uiua SBCS, 3 bytes

\×⊂

Try it!

K (ngn/k), 8 bytes

{x,x*\y}

Try it online!

Another easier-than-I-thought problem. \ is the scan operator.

Factor, 22 bytes

[ prefix cum-product ]

Try it online!

Desmos, 47 bytes

f(k,l)=∏_{n=1}^{[1...l.length+1]}join(k,l)[n]

Try It On Desmos!

Try It On Desmos! - Prettified

MathGolf, 6 5 bytes

\{\o*

Try it online!

I think this could be 5 bytes (\{\o*) but \ instruction seems a little off when dealing with input. This is now fixed in the latest version.

Explanation:

\       Swap arguments, pushing both to stack
 {      Foreach loop over second argument
  \o    Output counter with newline
    *   Multiply counter by current element
        Implicitly output the last element

J, 6 5 bytes

-1 byte thanks to Bubbler

*/\@,

Try it online!

Explanation:

A diadic verb, the left argument is a0, the rigth one - the vector

     @, - append the vector to a0 and 
  */\   - find the running product

dc, 13 bytes

p[*pz1<A]dsAx

Try it online!

p[*pz1<A]dsAx
p               # Print the first element
  *p            # Multiply top elements on the stack
 [  z1<A]dsAx   # until only one element is left

PowerShell, 29 bytes

param($a,$b)$a;$b|%{($a*=$_)}

Try it online!

This assumes just outputting the values is fine.

> .\scratch.ps1 1 (1,5,3,2)
1
1
5
15
30

If that's not fine, this actually builds the list and then pushes it to toString which prints the same way.

param($a,$b)$c=,$a;$b|%{$c+=$_*$c[-1]};$c #41 bytes

MATL, 3 bytes

hYp

Try it online!

            #implicit input, x_0 and A
h           #horizontally concatenate
Yp          #cumulative product
            #implicit output

The hYpe about MATL is real.

K (oK), 9 bytes

{(*\)x,y}

Try it online!

Joins the first number to the second input as a list, and then returns successive results of multiplication

Test Cases

Enter your input after the function like below and then run, as I'm unsure how to use input properly for this language in TiO

{(*\)x,y}[1;1 5 3 2]

Python 2, 40 bytes

f=lambda a,b:[a]+(b and f(a*b[0],b[1:]))

Try it online!

Surprisingly, the move to Python 3 and use of generators there only saves 1 byte over the recursive solution.

Pyth, 6 bytes

*FR._s

Test that one here!

Alternatively, 7 bytes:

.u*NYEQ

Test it here!

The first takes input as a tuple, the second takes input as two separate lines.

Thanks to @Sok for helping me with getting good at mapping and saving 1 byte.

05AB1E, 5 3 bytes

šηP

-2 bytes thanks to @BMO.

Try it online or verify all test cases.

Explanation:

š      # Prepend the (implicit) input-integer at the start of the (implicit) input-list
       #  i.e. -12 and [7,-1,-12,4] → ["-12",7,-1,-12,4]
 η     # Prefixes of this new list
       #  i.e. ["-12",7,-1,-12,4]
       #   → [["-12"],["-12",7],["-12",7,-1],["-12",7,-1,-12],["-12",7,-1,-12,4]]
  P    # Take the product of each inner list (and output implicitly)
       #  i.e. [["-12"],["-12",7],["-12",7,-1],["-12",7,-1,-12],["-12",7,-1,-12,4]]
       #   → [-12,-84,84,-1008,-4032]

Husk, 2 bytes

G*

Try it online!

This is equivalent to nimi's answer in Haskell: scanl(*), which means reduce from the left using multiplication, and return all partial results.

Python 3, 39 bytes

def f(a,b):
    for x in[1]+b:a*=x;yield a

Alternative approach. Returns a generator.

Try it online!

Common Lisp, 67 bytes

(lambda(a l &aux(y 1))(mapcar(lambda(x)(setf y(* y x)))(cons a l)))

Try it online!

Japt, 3 bytes

å*V

Try it


Explanation

        :Implicit input of array U and integer V
å       :Cumulatively reduce U
 *      :By multiplication
  V     :With an initial value of V

Batch, 69 bytes

@set/pa=
@echo %a%
@for %%d in (%*) do @set/aa*=%%d&call echo %%a%%

Takes input of \$a_0\$ on STDIN and the deltas as command-line arguments.

Charcoal, 12 bytes

IE⁺⟦N⟧AΠ⊞Oυι

Try it online! Link is to verbose version of code. Explanation:

    N           Input a₀
   ⟦ ⟧          Wrap in a list
      A         Input deltas as a list
  ⁺              Concatenate lists
 E              Map over elements
           ι    Current element
          υ     Predefined empty list variable
        ⊞O      Push and return updated list
       Π        Product
I               Cast to string
                Implicitly print each value on its own line

Python 2, 47 bytes

lambda n,A:reduce(lambda a,c:a+[a[-1]*c],A,[n])

Try it online!

Standard ML, 32 bytes

fun f(x::r)a=a::f r(a*x)|f&a=[a]

Try it online!

Ungolfed:

fun f (x::xr) a = a :: f xr (a*x)
  | f    _    a = [a]

APL(Dyalog), 3 bytes

×\∊

Try it online!

If I have to take the number on the left and the array on the right:

-2 thanks to @H.PWiz

7 5 3 bytes

×\,

R, 15 bytes

cumprod(scan())

Try it online!

Full program. Function is longer (unless we were allowed to "glue" the inputs together, so that built-in cumprod would suffice as a complete answer):

R, 28 bytes

function(i,x)cumprod(c(i,x))

Try it online!

Perl 6, 9 bytes

{[\*] @_}

Try it online!

JavaScript (ES6), 27 bytes

Takes input as (m)(a).

m=>a=>[m,...a.map(x=>m*=x)]

Try it online!

Wolfram Language (Mathematica), 14 bytes

FoldList@Times

Try it online!

FoldList[Times, a0, {x1, x2, ..., xn}] produces the desired output. FoldList[Times] is the curried form that produces a pure function still waiting for its a0 and {x1, x2, ..., xn}.

Jelly, 3 bytes

;×\

Try it online!

Haskell, 8 bytes

scanl(*)

Try it online!