Problem 2463. Sum of Dividend Digits
Find the smallest number that consist of only number 1's (e.g. 11111111111) which satisfy a given divisor and remainder. Then return the sum of its digits.
Example:
remainder = 7 divisor = 12
then dividend = 1111 and the resulting sum is 4.
Solution Stats
Problem Comments
-
2 Comments
is there any particular mathematical theory regarding this?..i cant find my way for large numbers.
Hint: For very large numbers made of many 1's, constructing the full number (like '1111111111...') and converting it using str2double will fail.
Instead, use modular arithmetic directly.
Solution Comments
Show commentsProblem Recent Solvers23
Suggested Problems
-
Back to basics 17 - white space
274 Solvers
-
Make a random, non-repeating vector.
10582 Solvers
-
218 Solvers
-
Write a function man that takes a row vector v and returns a matrix H as follows..
629 Solvers
-
Generate the sum of Squares of the given number
102 Solvers
More from this Author6
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!