Smith numbers are numbers such that if you add up all of the digits in the number, that sum equals the sum of all of the digits in all of their factors. This term was coined by Albert Wilansky, when he noticed the defining property in the phone number of his brother-in-law Harold Smith: 493-7775.
4+9+3+7+7+7+5=42
The prime factors of 4937775 are 3, 5, 5, and 65837. 3+5+5+(6+5+8+3+7) = 42
Since all prime numbers obviously meet this criteria, Smith numbers are defined as composite numbers. Write a MATLAB function that will tell you if a given number is a Smith number.
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers49
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
53114 Solvers
-
Back to basics 23 - Triangular matrix
1129 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
560 Solvers
-
341 Solvers
-
Count consecutive 0's in between values of 1
524 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Test cases are added to the problem.