1) You did not cycle from 0..N but simply calculated W for N=2. That way W only gets the value for N=2 ((18))
Solution: Write a prog which cycles from 0 to N calculates the values and append them to the vector W
2) Even then you could not use the sum symbol you tried as this only sums up vectors consisting of numbers. What your calculation of W produces is a nested vector.
Solution: change all calls to "pick(......)" to "pick(.....)[0" and you get a vector of the numbers you want which you can sum as you had tried.
comment: I think whatever you sheet should do could possibly be done less complicated. At least on first sight it looks like the combinaton of "match" and "pick" could be replaced by a simple use "lookup" - but then I may be wrong, so give it a try..
