Make me a metasequence
Wolfram Language (Mathematica), 34 bytes
0~Range~19~Binomial~i~Sum~{i,0,#}&
Try it online!
The tier \$n\$ metasequence is the sum of the first \$n+1\$ elements of each row of the Pascal triangle.
Haskell, 34 bytes
(iterate(init.scanl(+)1)[1..20]!!)
Uses 0-indexed inputs (f 4
returns tier 5.)
Haskell, 36 bytes
f 1=[1..20]
f n=init$scanl(+)1$f$n-1
Try it online! Uses 1-indexed inputs (f 5
returns tier 5.)
Explanation
scanl (+) 1
is a function that takes partial sums of a list, starting from (and prepending) 1
.
For example:
scanl (+) 1 [20,300,4000]
equals[1,21,321,4321]
.
It turns out that tier \$n\$ is just this function applied \$ (n-1) \$ times to the list \$[1,2,3,\dots]\$.
(Or equivalently: \$n\$ times to a list of all ones.)
We use either init
or [1..20-n]
to account for the list getting longer by \$1\$ every application.
Jelly, 8 7 bytes
20ḶcþŻS
Try it online!
cþ Table of binom(x,y) where:
20Ḷ x = [0..19]
Ż y = [0..n] e.g. n=3 → [[1, 1, 1, 1, 1, 1, …]
[0, 1, 2, 3, 4, 5, …]
[0, 0, 1, 3, 6, 10, …]
[0, 0, 0, 1, 4, 10, …]]
S Columnwise sum. → [1, 2, 4, 8, 15, 26, …]
This uses @alephalpha’s insight that $$\text{meta-sequence}_n(i) = \sum_{k=0}^n \binom ik.$$