Sum of Squares 1 to N Problem

Sum of Squares 1 to N Problem — ExecCode School DSA Practice

Solve the Sum of Squares 1 to N problem on ExecCode. Free online school DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given an integer N, compute and print the sum of the squares of all integers from 1 to N. Your task is to understand the rule and print the correct answer. You are working on Sum of Squares 1 to N.

Examples

Input 1; Output 1. Input 3; Output 14

Constraints

1 <= n <= 10^5

Practice Sum of Squares 1 to N free on ExecCode. Browse DSA problems, topic map, and placement guides.