Problem 42418. Divisible by 16
Solution Stats
Problem Comments
-
3 Comments
James
on 29 Jun 2015
Another trick: if the last 4 digits of the number are divisible by 16, the full number is divisible by 16. So far as I know, if the last X digits of a number are divisible by 2^X, the entire number is divisible by 2^X.
Alfonso Nieto-Castanon
on 29 Jun 2015
@James: nice trick! (and I guess the proof arises from 10^x being always exactly divisible by 2^x, so "iff" also applies?)
Alfonso Nieto-Castanon
on 29 Jun 2015
perhaps less interesting but I guess you could do the same with powers of 5, iff the last X digits of a number are divisible by 5^x, then the entire number is divisible by 5^x...
Solution Comments
Show commentsProblem Recent Solvers167
Suggested Problems
-
1788 Solvers
-
2659 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
783 Solvers
-
342 Solvers
-
482 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!