Skip to main content
Saved 2 bytes.
Source Link
user48543
user48543

Husk, 2121 19 bytes

↑⁰↑mȯ!²Tm₁N
¢+R⁰0…→Σ←⁰Σ⁰⁰¢§+`R0§…ȯ→Σ←ΣN

Takes arguments as n (01-indexed), then x.
NotSaved 2 bytes thanks to BMO, but still not as short as BMO's answer, but my.
My first attempt at using Husk.
Try it online!Try it online!

Husk, 21 bytes

↑⁰!²Tm₁N
¢+R⁰0…→Σ←⁰Σ⁰

Takes arguments as n (0-indexed), then x
Not as short as BMO's answer, but my first attempt at using Husk.
Try it online!

Husk, 21 19 bytes

↑mȯ!⁰¢§+`R0§…ȯ→Σ←ΣN

Takes arguments as n (1-indexed), then x.
Saved 2 bytes thanks to BMO, but still not as short as BMO's answer.
My first attempt at using Husk.
Try it online!

Source Link
user48543
user48543

Husk, 21 bytes

↑⁰!²Tm₁N
¢+R⁰0…→Σ←⁰Σ⁰

Takes arguments as n (0-indexed), then x
Not as short as BMO's answer, but my first attempt at using Husk.
Try it online!