Determine if input is a Harshad number - MATLAB Cody - MATLAB Central

Problem 57502. Determine if input is a Harshad number

Difficulty:Rate
In mathematics a harshad number (or Niven number) in a given number base is an integer that is divisible by the sum of its digits when written in that base.
Example: 2023 is a harshad number because 2023 / (2+0+2+3) = 289
Assume all numbers in this problem are in 10 base

Solution Stats

88.89% Correct | 11.11% Incorrect
Last Solution submitted on Feb 13, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8

Problem Recent Solvers16

Suggested Problems

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!