Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. decompose[p1_, p2_] :=
  2. Module[{x1 = p1, x2 = p2},
  3. If[x1 <= x2,
  4. Sum[Print[k1, x2 - x1 + 2 k2, k1], {k1, 0, x1}, {k2, 0, x1 - k1}],
  5. Print["Wrong values for the p1 and the p2"]]]
  6.  
  7. decompose[2, 2]
  8.  
  9. 6 Null
  10.  
  11. There are 6 channels
  12.  
  13. 000
  14.  
  15. 020
  16.  
  17. 040
  18.  
  19. 101
  20.  
  21. 121
  22.  
  23. 202
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement