10 harshad number


See On Github

Data

Contributor

Generic placeholder thumbnail

by jcla1

in scala

Tags

Source Code

def digits(n: Int): Array[Int] =
    n.toString.split("").drop(1).map(_.toInt)

def isHarshad(n: Int): Boolean =
    n % digits(n).sum == 0