Represented a positive integer number as a sum of multiple positive integer numbers.

版本 1.0.0.0 (1.4 KB) 作者: Pramit Biswas
A positive integer number N is represented as a sum of K positive integer numbers.
35.0 次下载
更新时间 2017/1/12

查看许可证

A positive integer number N can be represented as a
sum of K positive integer numbers.
i.e, N = n1 + n2 + ... + nk
E.g. 1: 6(N) can be represented as a sum of 2(K) numbers in following way: (1+5), (2+4), (3+3).
E.g. 2: 8(N) can be represented as a sum of 3(K) numbers in following way: (1+1+6), (1+2+5), (1+3+4), (2+2+4), (2+3+3).
To run this function, sample input:
N_as_sum_of_K_numbers(8,3)
Points to remember:
1. N, K both should be positive integer
2. do not give more than two inputs, it will give wrong or no result

引用格式

Pramit Biswas (2024). Represented a positive integer number as a sum of multiple positive integer numbers. (https://www.mathworks.com/matlabcentral/fileexchange/61122-represented-a-positive-integer-number-as-a-sum-of-multiple-positive-integer-numbers), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2007a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0