Problem 42411. Divisible by 9
Pursuant to the first problem in this series, this one involves checking for divisibility by 9.
Write a function to determine if a number is divisible by 9. This can be done by the following method:
- Sum the digits of the number. As with methods for other numbers, this summing step can be applied recursively until a single-digit number results. If the resulting number is divisible by nine, then so is the original number.
Previous problem: divisible by 8. Next problem: divisible by 10.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers256
Suggested Problems
-
7441 Solvers
-
Sum all integers from 1 to 2^n
14176 Solvers
-
Make a run-length companion vector
632 Solvers
-
Sum of first n positive integers
565 Solvers
-
1168 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!