7 kyu

Sum of Triangular Numbers

5,661 of 17,704ThomasL

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 Trained33511
Total Skips5122
Total Code Submissions45901
Total Times Completed17704
JavaScript Completions5661
Ruby Completions385
Python Completions4148
C# Completions874
C Completions1592
Java Completions2154
TypeScript Completions469
CoffeeScript Completions24
C++ Completions1972
Haskell Completions225
Crystal Completions21
NASM Completions59
Julia Completions31
Prolog Completions30
R Completions67
COBOL Completions15
Factor Completions16
SQL Completions849
Total Stars261
% of votes with a positive feedback rating89% of 2109
Total "Very Satisfied" Votes1708
Total "Somewhat Satisfied" Votes344
Total "Not Satisfied" Votes57
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