+ 1
Find the sum of the series 1+4+9+16+...........+100
what is the code with output
2 Answers
+ 15
n (n+1)(2n+1)/6
//sometimes simple math helps âș
+ 5
Looks like you are searching for the sum of a series of squared numbers.
You could either use a for-loop to iterate through the numbers from 1-10 and add their square to a variable holding the sum, or you could use this formular:
https://code.sololearn.com/cZU28jZKCiFZ/?ref=app