7 kyu
Triangular Treasure
2,604 of 29,031JulianNicholls
Description:
Triangular numbers are so called because of the equilateral triangular shape that they occupy when laid out as dots. i.e.
1st (1) 2nd (3) 3rd (6)
* ** ***
* **
*
You need to return the nth triangular number. You should return 0 for out of range values:
For example: (Input --> Output)
0 --> 0
2 --> 3
3 --> 6
-10 --> 0
Algorithms
Mathematics
Similar Kata:
Stats:
Created | Oct 16, 2013 |
Published | Oct 16, 2013 |
Warriors Trained | 53468 |
Total Skips | 6698 |
Total Code Submissions | 103324 |
Total Times Completed | 29031 |
Ruby Completions | 2604 |
JavaScript Completions | 9725 |
CoffeeScript Completions | 474 |
Haskell Completions | 626 |
C# Completions | 2510 |
Java Completions | 5231 |
Python Completions | 4661 |
Dart Completions | 1188 |
Swift Completions | 1673 |
C Completions | 629 |
Clojure Completions | 66 |
COBOL Completions | 12 |
Factor Completions | 15 |
Julia Completions | 31 |
Rust Completions | 221 |
NASM Completions | 61 |
SQL Completions | 979 |
TypeScript Completions | 121 |
Scala Completions | 19 |
Total Stars | 286 |
% of votes with a positive feedback rating | 84% of 2613 |
Total "Very Satisfied" Votes | 1949 |
Total "Somewhat Satisfied" Votes | 516 |
Total "Not Satisfied" Votes | 148 |