No. of solutions of equation? Given an equation $a_1 X_1 + a_2 X_2 + \cdots + a_n X_n = N$ where $a_1,a_2,\ldots,a_n$ are positive constants and each $X_i$ can take only two values $\{0,1\}$. $N$ is a given constant. How can we calculate the possible no of solutions of given equation ?

This is counting the number of solutions to the knapsack problem. You can adapt the Dynamic Programming algorithm to do this in pseudopolynomial time. (I'm assuming the input data are integers.) Let $s[i,w]$ = # of ways to achieve the sum $w$ using only the first $i$ variables.
Then $$s[0,w]=\begin{cases}1 & w=0 \\0 & w \ne 0\end{cases}$$
For $i=1\ldots n$, For $w=0\ldots N$
$$s[i,w] = s[i-1,w] + s[i-1,w-a_i]$$
