Square pyramidal number (Sum of squares) of first n natural numbers in C# – Programming, Pseudocode Example, C# Programming Example
C# Console For Loop

Square pyramidal number (Sum of squares) of first n natural numbers in C#

In mathematics, a pyramid number, or square pyramidal number, is a figurate number that represents the number of stacked spheres in a pyramid with a square base. Square pyramidal numbers also solve the problem of counting the number of squares in an n × n grid.

A Square pyramidal number represents sum of squares of first natural numbers. First few Square pyramidal numbers are 1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, …

In this example i’ll show you How to calculate Sum of squares of first n natural numbers in C#.

C# Code:

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.