Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
AWK/wasi0013
C#/Davipb
C++/alsuga
C/jb1717
Erlang/Sweet-kid
Go/jcla1
Java/darubramha89
Javascript/jcla1
Lua/Yonaba
Perl/Sweet-kid
Python
Racket/Mukesh
Ruby_Dir/GreenJoey
Scala/jcla1
README.md
Ruby
tags

README.md

Puzzle: A Harshad Number, in a given number base, is an integer that is divisible by the sum of its digit when written in that base.

Write a function that returns whether an integer is a Harshad Number or not (in base 10).

Solution: Of the numbers from 1-200, the following are Harshad Numbers:

1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
12, 18, 20, 21, 24, 27, 30, 36,
40, 42, 45, 48, 50, 54, 60, 63,
70, 72, 80, 81, 84, 90, 100, 102,
108, 110, 111, 112, 114, 117, 120,
126, 132, 133, 135, 140, 144, 150,
152,153, 156, 162, 171, 180, 190,
192, 195, 198, 200