a = [4,3,2,1]
n = len(a)
s = [a[1]]
for k in range(1, 10):
    _s = 0
    for i in range(1, k):
        _s += (a[i] if i < len(a) else 0) * s[k - i] * (1 if i % 2 else -1)
    _s += (1 if k %2 else -1) * (a[k] if k < len(a) else 0)

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: