8 kyu

Grasshopper - Summation

102,175 of 281,682danleavitt0

Description:

Summation

Write a program that finds the summation of every number from 1 to num (both inclusive). The number will always be a positive integer greater than 0. Your function only needs to return the result, what is shown between parentheses in the example below is how you reach that result and it's not part of it, see the sample tests.

For example (Input -> Output):

2 -> 3 (1 + 2)
8 -> 36 (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8)
Fundamentals
Mathematics

Similar Kata:

Stats:

CreatedAug 17, 2015
PublishedSep 3, 2015
Warriors Trained365038
Total Skips22403
Total Code Submissions533894
Total Times Completed281682
JavaScript Completions102175
Ruby Completions5646
Python Completions83758
CoffeeScript Completions97
Elixir Completions800
PHP Completions5689
C++ Completions17337
C# Completions14845
Java Completions26850
Crystal Completions102
BF Completions197
TypeScript Completions3634
Scala Completions938
Haskell Completions1491
Groovy Completions166
Kotlin Completions2871
NASM Completions155
Julia Completions185
Dart Completions1733
R Completions595
Reason Completions40
Nim Completions122
Racket Completions116
Factor Completions38
Go Completions4815
Clojure Completions436
Elm Completions124
PureScript Completions66
Forth Completions99
C Completions6470
Lua Completions620
CFML Completions46
Erlang Completions171
Fortran Completions100
F# Completions248
PowerShell Completions643
Prolog Completions89
Solidity Completions743
Swift Completions2720
VB Completions458
Shell Completions1203
Objective-C Completions85
Rust Completions2808
Perl Completions217
Raku Completions47
OCaml Completions218
CommonLisp Completions379
Pascal Completions274
Haxe Completions59
COBOL Completions69
D Completions64
SQL Completions1922
Total Stars1659
% of votes with a positive feedback rating91% of 17198
Total "Very Satisfied" Votes14321
Total "Somewhat Satisfied" Votes2567
Total "Not Satisfied" Votes310
Ad
Contributors
  • danleavitt0 Avatar
  • jhoffner Avatar
  • Javatlacati Avatar
  • cris Avatar
  • joh_pot Avatar
  • Unnamed Avatar
  • shadowmanos Avatar
  • hilary Avatar
  • datagram Avatar
  • donaldsebleung Avatar
  • aniametz Avatar
  • Chrono79 Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • docgunthrop Avatar
  • user4912975 Avatar
  • B1ts Avatar
  • lilsweetcaligula Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • Madjosz Avatar
  • MaikelNabil Avatar
  • mitron6 Avatar
  • Souzooka Avatar
  • metagn Avatar
  • FArekkusu Avatar
  • monadius Avatar
  • CarbonGrid Avatar
  • hobovsky Avatar
  • mcmlevi Avatar
  • cliffstamp Avatar
  • xavierguihot Avatar
  • stellartux Avatar
  • RobsonMoon Avatar
  • Foobywalla Avatar
  • username0 Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • Kacarott Avatar
  • dfhwze Avatar
  • 4500zenja1 Avatar
Ad