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.
@James: nice trick! (and I guess the proof arises from 10^x being always exactly divisible by 2^x, so "iff" also applies?)
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...
given 3 sides, find area of this triangle
Get the length of a given vector
Return the first and last characters of a character array
Area of an Isoceles Triangle
Divisible by 13
Divisible by n, Truncated-number Divisors
Stress-Strain Properties - 8
Large Sum (inspired by Project Euler 13)
Fill-a-pix - Solution Checker
Tic-Tac-Logic - Solution Checker
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office