I need to find how many ways there are to add up integers to a given number, $n$, such that at least one of them equal 1. i.e: $|${$(x_1,...,x_k) : 0\leq k \leq n, \sum _{i=1} ^k x_i=n,\exists i:x_i=1$}$|$
thanks!
note: i have been able to find a way for calculate the answer with recursion, but i couldn't find a formula.
my solution: Let $\sigma_n(k)=|${$(x_1,...,x_k):\sum x_i=n,\exists x_i=1$}$| $
and $ \gamma _n(k)=|${$(x_1,...,x_k):\sum x_i=n,\forall x_i\ne1$}$ $.
now we can see that forall k,n: $ \sigma_n(k)+\gamma_n(k)=\binom{n+k-1}{n} $.
Now we will define $ \xi_n(k,\ell)$ to be the number of all the sums of length $k$ that have exactly $\ell$ one's. we can see that $ \sigma_n(k)=\sum_{\ell=1}^k \xi_n(k,\ell) $.
we can notice that we can map all the sums that have $\ell$ ones and are of length $k$ to sums that have 0 ones and are of length $k-\ell$. this mapping sends $ \binom{n}{\ell}$ different sums that have ones to a single sum that doesn't.
so we see that: $\xi_{n}(k,\ell)=\binom{n}{\ell}\gamma_{n}(k-\ell)$.
After playing with the formulas we will get that $ \sigma_{n}(k)=\sum_{\ell=1}^{k}\binom{n}{\ell}\cdot\gamma_{n}(k-\ell)=\sum_{\ell=1}^{k}\binom{n}{\ell}\cdot\left(\binom{n+k-\ell-1}{n}-\sigma_{n}(k-\ell)\right)$ and we can evaluate $\sigma_n(k)$ recusively.
sorry if my english is bad, it's not my first languege :P
Note: the original post says "positive integer" and this solution is dedicated to that question, not the current one.
It is equal to the number of positive solutions minus the number of positive solutions all at least $2$.
The first number is $$n-1\choose k-1 $$
as it is same as placing $k-1$ sticks in the $n-1$ spaces between $n$ balls
For the second number,
note that $a_1+a_2+...+a_k=n$ where each $a_i\geq 2$ is same as $b_1+b_2+...+b_k=n-k$ where each $b_i=a_i-1$ and $b_i\geq 1$.
So the total number is
$${n-1\choose k-1} - {n-k-1\choose k-1}$$
Edited to include zero: If zero is allowed, then we have to add up all the cases for different numbers of zeroes and I believe there is no clean formula.
With $0$ zeroes: ${k \choose 0}({n-1\choose k-1} - {n-k-1\choose k-1})$
With $1$ zeroes: ${k \choose 1}({n-1\choose k-2} - {n-k-1\choose k-2})$
With $3$ zeroes: ${k \choose 2}({n-1\choose k-3} - {n-k-1\choose k-3})$
And so on. The sum will then be
$$\sum_{i=0}^{k-1}{k \choose i}({n-1\choose k-1-i} - {n-k-1\choose k-1-i})$$