1

How many ways can I write a positive integer n as a sum of k nonnegative integers up to commutativity with condition the large number of k is d ?

For example, I can write 8 as 4+3+1, 4+1+3, 3+4+1, 3+1+4, 1+4+3, 1+3+4, 4+2+2, 2+4+2 and 2+4+4 where k=3 and d=4.

haman
  • 51
  • find $a_n$ using $a_{n-1}$ then solve the equation. – Taha Akbari Sep 28 '16 at 19:33
  • please can you explain more – haman Sep 28 '16 at 19:38
  • 3
    It seems you mean a sum of positive integers, not non-negative integers. (Otherwise you would also have $4=4+0+0, 4=3+1+0$, etc.) – Théophile Sep 28 '16 at 19:39
  • No i dont have 0 in my compositions – haman Sep 28 '16 at 19:40
  • 1
    " I can write 4 as 4+3+1" but $4 + 3 + 1 = 8$. Also can you clarify "with condition the large nuumber of $k$ is $d$"? – Caleb Stanford Sep 28 '16 at 19:40
  • https://en.wikipedia.org/wiki/Integer_partitions – Eman Yalpsid Sep 28 '16 at 19:41
  • sorry not 4 is 8 – haman Sep 28 '16 at 19:41
  • Assuming that $d$ appears only once, the number of such solutions is given by the coefficient of $x^{n-d}$ in $\left(1+x+x^2+\ldots+x^{d-1}\right)^{k-1}$ multiplied by $k$. Assuming that $d$ appears twice, the number of such solutions is given by the coefficient of $x^{n-2d}$ in $(1+x+x^2+\ldots+x^{d-1})^{k-2}$ multiplied by $\binom{k}{2}$ and so on. Now have a look at stars and bars (https://en.wikipedia.org/wiki/Stars_and_bars_(combinatorics)). I do not think there is a simple closed formula. – Jack D'Aurizio Sep 28 '16 at 20:27
  • Should be something like https://math.stackexchange.com/questions/217597/number-of-ways-to-write-n-as-a-sum-of-k-nonnegative-integers, but you subtract d so 0 is included – Einsteinium Jan 28 '23 at 03:18

0 Answers0