The number
has the property that
and
have the same digit sum. It is the seventh number, including zero, in the sequence of numbers with that property.
Write a function to find the nth term in the sequence, where n can be a vector.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers8
Suggested Problems
-
Back to basics 21 - Matrix replicating
1833 Solvers
-
565 Solvers
-
Add a row of zeros on top of a matrix
269 Solvers
-
ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
607 Solvers
-
Find out sum of prime number till given number
273 Solvers
More from this Author330
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
> It is the sixth number, including zero, in the sequence of numbers with that property.
Isn't it the seventh?
Also, out of curiosity, why are you disallowing persistent variables?
Yes, seventh--corrected, thanks. Bitten by the "off by one bug" again.
Banning persistent is to add the challenge of dealing with large numbers in Cody time. A while ago I found a quicker way to find the digit sums of a lot of numbers, and this problem was another place to exploit that method.