Skip to main content
Mathematics LibreTexts

3.3: Divisibility rules revisited

  • Page ID
    7628
  • This page is a draft and is under active development. 

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Thinking out Loud

    Can any integer \(n\) be written as a sum of distinct powers of \(2\)?

    Example \(\PageIndex{1}\):

    Express \(2019\) as a sum of distinct powers of \(2\)?

    Note that, \(10 \equiv 1 ( mod \,\,3), 10 \equiv 1 ( mod\, 9),\) and \(10 \equiv (-1)( mod \,\,11),\).

    Let \(x \in \mathbb{Z_+}\).

    Then \[ x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0,\]

    which implies

    \[x= 10( d_n10^{n-1} +d_{n-1}10^{n-2}+ \cdots+ d_2 10+d_1)+d_0.\]

    Thus we can express \(x\) as \(10 a+b\), where \(b=d_0\) is the ones digit of \(x\), and \(a= d_n10^{n-1} +d_{n-1}10^{n-2}+ \cdots+ d_2 10+d_1\).

    Divisibility by \(2=2^1:\)

    Let \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\in \mathbb{Z_+}\), then \(2 \mid x\) iff \(2 \mid d_0\). In other words, \(2\) divides an integer iff the ones digit of the integer is either \(0, 2, 4, 6,\) or \( 8\). That is. \(x \equiv 0 (mod \,2) \) iff \(d_0 \equiv 0 (mod \,2)\).

    Proof:

    Since \( 10 \equiv 0 (mod \,2) \) and \(x=10 a+b\), \(x \equiv 0 (mod \,2) \) iff \(d_0 \equiv 0 (mod \,2)\).\(\Box\)

    Divisibility by \(5:\)

    Let \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\in \mathbb{Z_+}\), then \(5 \mid x\) iff \(5 \mid d_0\). In other words, \(5\) divides an integer iff the ones digit of the integer is either \(0,\) or \( 5\).

    That is. \(x \equiv 0 (mod \,\,5) \) iff \(d_0 \equiv 0 (mod \,\,5)\).

    Proof:

    Since \( 10 \equiv 0 (mod \,5) \) and \(x=10 a+b\), \(x \equiv 0 (mod \,5) \) iff \(d_0 \equiv 0 (mod \,5)\).\(\Box\)

    Divisibility by \(10:\)

    Let \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\in \mathbb{Z_+}\), then \(10 \mid x\) iff \(10 \mid d_0\). In other words, \(10\) divides an integer iff the ones digit of the integer is \(0,\).

    That is. \(x \equiv 0 (mod \,10) \) iff \(d_0 \equiv 0 (mod \,10)\).

    Proof:

    Since \( 10 \equiv 0 (mod \,10) \) and \(x=10 a+b\), \(x \equiv 0 (mod \,10) \) iff \(d_0 \equiv 0 (mod \,10)\).\(\Box\)

    Divisibility by \(4=2^2:\)

    Let \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\in \mathbb{Z_+}\), then \(4 \mid x\) iff \( 4 \mid d_1d_0\). That is. \(x \equiv 0 (mod \,4) \) iff \(d_1d_0 \equiv 0 (mod \,4)\).

    Proof:

    Let \(x\) be an integer. Then

    \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\), which implies

    \(x= 100( d_n10^{n-2} +d_{n-1}10^{n-3}+ \cdots+ d_2)+ 10d_1+d_0=100( d_n10^{n-2} +d_{n-1}10^{n-3}+ \cdots+ d_2)+ d_1d_0\).

    Since \( 100 \equiv 0 (mod \,4)\), \(x=100 a+ d_1d_0\), \(x \equiv 0 (mod \,4) \) iff \(d_1d_0 \equiv 0 (mod \,4)\).\(\Box\)

    Divisibility by \(8=2^3:\)

    Let \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\in \mathbb{Z_+}\), then \(8 \mid x\) iff \( 8 \mid d_2d_1d_0\). That is. \(x \equiv 0 (mod \,8) \) iff \(d_2d_1d_0 \equiv 0 (mod \,8)\).

    Proof:

    Let \(x\) be an integer. Then

    \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\), which implies

    \(x= 10^3( d_n10^{n-3} +d_{n-1}10^{n-4}+ \cdots+ d_3)+ 100d_2+10d_1+d_0=10^3( d_n10^{n-3} +d_{n-1}10^{n-4}+ \cdots+ d_3)+ d_2d_1d_0\).

    Since \( 1000 \equiv 0 (mod \,8)\), \(x=1000 a+ d_2d_1d_0\), \(x \equiv 0 (mod \,8) \) iff \(d_2d_1d_0 \equiv 0 (mod \,8)\).\(\Box\)

    A similar argument can be made for divisibility by \(2^n\), for any positive integer \(n\). The following results follows from the fact that,

    \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0 = d_n(10^n-1) +d_{n-1}(10^{n-1}-1)+ \cdots+ d_2 (10^2-1)+d_1(10^1-1)+ (d_n+d_{n-1}+ \cdots+ d_1+ d_0)\).

    Divisibility by \(3:\)

    Let \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\in \mathbb{Z_+}\), then \(3 \mid x\) iff \(3\) divides sum of its digits.

    Proof:

    Let \(x\) be an integer. Then

    \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\), which implies \(x= d_n(10^n-1) +d_{n-1}(10^{n-1}-1)+ \cdots+ d_2 (10^2-1)+d_1(10^1-1)+ (d_n+d_{n-1}+ \cdots+ d_1+ d_0)\).

    Hence, \(x (mod \,3) \equiv d_n(10^n-1) +d_{n-1}(10^{n-1}-1)+ \cdots+ d_2 (10^2-1)+d_1(10^1-1)) (mod \,3)+ (d_n+d_{n-1}+ \cdots+ d_1+ d_0) (mod \,3).\)  Notice that \((10^n-1) \equiv 0 (mod \, 3), \) for all positive integer \(n.\)

    Therefore, \(x (mod \,3) \equiv (d_n+d_{n-1}+ \cdots+ d_1+ d_0) (mod \,3).\)

     Thus, \(3 \mid x\) iff \(3\) divides sum of its digits.

     

    Divisibility by \(9=3^2:\)

    Let \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\in \mathbb{Z_+}\), then \(9 \mid x\) iff \(9\) divides sum of its digits.

    Proof:

    Let \(x\) be an integer. Then

    \( x= d_n10^n +d_{n-1}10^{n-1}+ \cdots+ d_2 10^2+d_110^1+d_0\), which implies \(x= d_n(10^n-1) +d_{n-1}(10^{n-1}-1)+ \cdots+ d_2 (10^2-1)+d_1(10^1-1)+ (d_n+d_{n-1}+ \cdots+ d_1+ d_0)\).

    Hence, \(x (mod \,9) \equiv d_n(10^n-1) +d_{n-1}(10^{n-1}-1)+ \cdots+ d_2 (10^2-1)+d_1(10^1-1)) (mod \,9)+ (d_n+d_{n-1}+ \cdots+ d_1+ d_0) (mod \,9).\)  Notice that \((10^n-1) \equiv 0 (mod \, 9), \) for all positive integer \(n.\)

    Therefore, \(x (mod \,9) \equiv (d_n+d_{n-1}+ \cdots+ d_1+ d_0) (mod \,9).\)

     Thus, \(9 \mid x\) iff \(9\) divides sum of its digits.

    Divisibility by \(7:\)

    \(7 \mid x\) iff \(7\) divides the absolute difference between \(a-2b\), where \(x=10 a+b\), and, \(b=d_0\) is the ones digit of \(x\) and \(a= d_n10^{n-1} +d_{n-1}10^{n-2}+ \cdots+ d_2 10+d_1\).

    Proof:

    Divisibility by \(11:\)

    \(11 \mid x\) iff \(11\) divides the absolute difference between alternate sum.

    Proof:


    This page titled 3.3: Divisibility rules revisited is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Pamini Thangarajah.

    • Was this article helpful?