The quotient of a Moran number and its digit sum is prime. For example, 117 and 481 are Moran numbers because 117/(1+1+7) is 13 and 481/(4+8+1) = 37, and both 13 and 37 are prime.
Write a function to list the Moran numbers less than or equal to the input number.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers22
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15782 Solvers
-
351 Solvers
-
Remove entire row and column in the matrix containing the input values
554 Solvers
-
Chebyshev polynomials of the 1st Kind
80 Solvers
-
350 Solvers
More from this Author321
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
@Tim, thanks for the idea of using ismember(). It greatly simplified my already simplest solution to date. All I did before was squeeze a literal implementation and make it work just fast enough to fit the one-minute filter..Your inspiration took me from four statements to two.
I believe I have the right solution but it is not fast enough, can anyone advise me on how to get the digit sum without using a for loop?