6 kyu
Twisted Sum
1,088 of 6,017agram
Description:
Find the sum of the digits of all the numbers from 1
to N
(both ends included).
Examples
# N = 4
1 + 2 + 3 + 4 = 10
# N = 10
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + (1 + 0) = 46
# N = 12
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + (1 + 0) + (1 + 1) + (1 + 2) = 51
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Nov 9, 2013 |
Published | Nov 9, 2013 |
Warriors Trained | 9251 |
Total Skips | 582 |
Total Code Submissions | 23983 |
Total Times Completed | 6017 |
Ruby Completions | 1088 |
C# Completions | 605 |
Python Completions | 2563 |
Clojure Completions | 57 |
F# Completions | 37 |
C Completions | 224 |
Groovy Completions | 62 |
JavaScript Completions | 1494 |
CoffeeScript Completions | 11 |
Crystal Completions | 9 |
Julia Completions | 20 |
COBOL Completions | 11 |
Factor Completions | 10 |
Total Stars | 134 |
% of votes with a positive feedback rating | 94% of 795 |
Total "Very Satisfied" Votes | 706 |
Total "Somewhat Satisfied" Votes | 80 |
Total "Not Satisfied" Votes | 8 |