7 kyu

Sum of Triangular Numbers

5,643 of 17,602ThomasL

Description:

Your task is to return the sum of Triangular Numbers up-to-and-including the nth Triangular Number.

Triangular Number: "any of the series of numbers (1, 3, 6, 10, 15, etc.) obtained by continued summation of the natural numbers 1, 2, 3, 4, 5, etc."

[01]
02 [03]
04 05 [06]
07 08 09 [10]
11 12 13 14 [15]
16 17 18 19 20 [21]

e.g. If 4 is given: 1 + 3 + 6 + 10 = 20.

Triangular Numbers cannot be negative so return 0 if a negative number is given.

Mathematics
Fundamentals

More By Author:

Check out these other kata created by ThomasL

Stats:

CreatedOct 20, 2016
PublishedOct 20, 2016
Warriors Trained33312
Total Skips5103
Total Code Submissions45658
Total Times Completed17602
JavaScript Completions5643
Ruby Completions385
Python Completions4120
C# Completions871
C Completions1587
Java Completions2145
TypeScript Completions467
CoffeeScript Completions24
C++ Completions1962
Haskell Completions225
Crystal Completions21
NASM Completions57
Julia Completions31
Prolog Completions30
R Completions65
COBOL Completions15
Factor Completions16
SQL Completions823
Total Stars260
% of votes with a positive feedback rating89% of 2105
Total "Very Satisfied" Votes1707
Total "Somewhat Satisfied" Votes342
Total "Not Satisfied" Votes56
Total Rank Assessments8
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • ThomasL Avatar
  • GiacomoSorbi Avatar
  • raulbc777 Avatar
  • user5036852 Avatar
  • B1ts Avatar
  • lxdlam Avatar
  • Voile Avatar
  • clcraig Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • dfhwze Avatar
Ad