Difference of the Square of Sums and the Sum of Squares

版本 1.0.0.0 (1.9 KB) 作者: Andrew Chen
A function called on a single natural number.
26.0 次下载
更新时间 2016/9/14

查看许可证

Call this function to evaluate a NATRUAL number x --> dsumsquare(x) This function will produce the difference of the sum of squares of a ll natural numbers 1 to x and the square of the sum of natural numbers 1 to x.
For example:
dsumsquare(3) = (1+2+3)^2-(1^2+2^2+3^2) = 36-14 = 22

引用格式

Andrew Chen (2024). Difference of the Square of Sums and the Sum of Squares (https://www.mathworks.com/matlabcentral/fileexchange/59140-difference-of-the-square-of-sums-and-the-sum-of-squares), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
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