Code covered by the BSD License  

Highlights from
Divisibility rule by 7

Be the first to rate this file! 13 Downloads (last 30 days) File Size: 1.36 KB File ID: #32877

Divisibility rule by 7

by

 

13 Sep 2011 (Updated )

This code helps us to verify whether a number is divisible by 7 using the divisibility rule

| Watch this File

File Information
Description

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

MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
14 Sep 2011

rename title

Contact us