6 kyu

Multiples of 3 or 5

52,456 of 448,121jhoffner

Description:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Finish the solution so that it returns the sum of all the multiples of 3 or 5 below the number passed in.

Note: If the number is a multiple of both 3 and 5, only count it once.

Courtesy of projecteuler.net (Problem 1)

Mathematics
Algorithms

Stats:

CreatedMar 21, 2013
PublishedMar 28, 2013
Warriors Trained778355
Total Skips63389
Total Code Submissions1267513
Total Times Completed448121
JavaScript Completions137453
CoffeeScript Completions466
Ruby Completions10932
Clojure Completions1134
Python Completions148167
C# Completions31304
Java Completions52456
Haskell Completions3316
C++ Completions28463
Elixir Completions857
TypeScript Completions8621
PHP Completions9062
Swift Completions3019
Go Completions7184
Rust Completions5381
C Completions13803
R Completions734
Nim Completions98
F# Completions333
Scala Completions1189
Lua Completions640
Shell Completions632
PowerShell Completions338
Crystal Completions69
NASM Completions75
Julia Completions272
Kotlin Completions3359
Racket Completions147
Dart Completions2043
Factor Completions36
Prolog Completions69
Raku Completions35
COBOL Completions53
CommonLisp Completions155
D Completions29
VB Completions64
Groovy Completions17
Total Stars3615
% of votes with a positive feedback rating88% of 40441
Total "Very Satisfied" Votes31922
Total "Somewhat Satisfied" Votes7709
Total "Not Satisfied" Votes810
Ad
Contributors
  • jhoffner Avatar
  • OverZealous Avatar
  • curtmack Avatar
  • dnolan Avatar
  • Azuaron Avatar
  • fenra Avatar
  • Osmosis Avatar
  • Metal Wing Avatar
  • anter69 Avatar
  • lechevalier Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • kleidemos Avatar
  • B1ts Avatar
  • CajetanP Avatar
  • Firefly2002 Avatar
  • calebkleveter Avatar
  • leometzger Avatar
  • user9040298 Avatar
  • rowcased Avatar
  • mentalplex Avatar
  • dolgov_vv Avatar
  • kdmatrosov Avatar
  • Bubbler Avatar
  • metagn Avatar
  • JavaCommons Avatar
  • bassopenguin Avatar
  • spudboy Avatar
  • hobovsky Avatar
  • user3029010 Avatar
  • Console Cowboy Avatar
  • uniapi Avatar
  • stellartux Avatar
  • tonylicoding Avatar
  • user8436785 Avatar
  • y0sik Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • dfhwze Avatar
  • NikCSharp Avatar
  • Captain Quack Avatar
  • JavaScripts Avatar
Ad