http://www.perlmonks.org?node_id=521382


in reply to Re^2: Obtaining terms in an expansion
in thread Obtaining terms in an expansion

I don't see an operator between arr[0][0] and arr[1][0], so I presume the parenthesis mean you want to multiply.

Your description does not adequately explain what you want, particularly the (a[N-1][0] + a[N-1][1]).

Indices from your example:

0,0 1,0 0,0 1,1 0,1 1,0 0,1 1,1
Don't follow. They should be:
0,0 1,0 0,0 1,1 1,0 1,0 1,1 1,1 2,0 1,0 2,1 1,1 3,0 1,0 3,1 1,1 ...
The wrong element is incrementing -- a[0][N-1] * a[1][0], a[0][N-1] * a[1][1].

Furthermore, this makes no sense. Are a[0][1] and a[1][1] use repeatedly throughout? If so, why not change them into constants?

Celebrate Intellectual Diversity