Sum the squares of numbers from 1 to n - MATLAB Cody - MATLAB Central

Problem 42663. Sum the squares of numbers from 1 to n

Difficulty:Rate

For a given value of n return the sum of square of numbers from 1 to n.

Example

For n = 2 then sum of squares = 5 (1^2 + 2^2)

Solution Stats

65.51% Correct | 34.49% Incorrect
Last Solution submitted on Feb 24, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers249

Suggested Problems

Problem Tags

sum

Community Treasure Hunt

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

Start Hunting!
Go to top of page