Divisibility rule by 7
Version 1.1.0.0 (1.36 KB) by
Diyashvir Kreetee Rajiv Babajee
This code helps us to verify whether a number is divisible by 7 using the divisibility rule
1 we express a number as a linear combination of powers of 10
2 for example
1980=1*10^3+9*10^2+8*10^1+0*10^0
we get [1 9 8 1]
apply divisibility rule by 7
remaining digits-2(last digit)
k=1
1 9 8 -2(1)=196
k=2
19 - 2(6)=7
k=3
0-2(7)=-14 which is divisible by 7
stop we get a negative number
Cite As
Diyashvir Kreetee Rajiv Babajee (2024). Divisibility rule by 7 (https://www.mathworks.com/matlabcentral/fileexchange/32877-divisibility-rule-by-7), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2010a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Image Processing Toolbox > Import, Export, and Conversion > Image Sequences and Batch Processing >
Find more on Image Sequences and Batch Processing in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.