P(n) = 1^2 + 2^2 + ... + n^2
P(1) = 1
P(2) = 1 + 4 = 5;
P(3) = 5 + 9 = 14;
P(4) = 14 + 16 = 30;
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers104
Suggested Problems
-
918 Solvers
-
Project Euler: Problem 10, Sum of Primes
2089 Solvers
-
Arrange vector in ascending order
816 Solvers
-
981 Solvers
-
Create an index-powered vector
935 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!