# Moderate Number System Solved QuestionAptitude Discussion

 Q. What is the remainder when $3^7$ is divided by $8$?
 ✖ A. 1 ✖ B. 2 ✔ C. 3 ✖ D. 5

Solution:
Option(C) is correct

We know that $3^7 = 3×3^3 ×3^3 = 3 × 27 ×27 = 3(27^2 )$.

The number immediately before 27 that is divisible by 8 is 24.

Hence, replace 27 with $24 + 3$.

Then we have:

$3^7 = 3(27^2) = 3(24 + 3)^2 = 3(24^2 + 2×24×3 + 3^2)$

$= 3×24^2 + 3×2×24×3 + 3×9$

Now,

$\dfrac{3^7}{8} = \dfrac{3×24^2 + 3×2×24×3 + 3×9}{8}$

$=3×\dfrac{24^2}{8} + 3×2×24×\dfrac{3}{8} + 3×\dfrac{9}{8}$

$= \text{Integer + Integer } + \dfrac{27}{8}$

$= \text{Integer + Integer} + \dfrac{24 +3}{8}$

$= \text{Integer + Integer} + 3 + \dfrac{3}{8}$

Hence, the remainder is 3

Edit: For a generalized solution for remainder problems, check comment by Gannu.

Edit 2: For an alternative method, check comment by Shobhit.

Edit 3: For a shortcut alternative method, check comment by Shobia.

Edit 4: For yet another alternative solution check comment by Saikat Chakraborty.

Edit 5: For yet another alternative solution using 'modulus' method, check comment by Sravan Reddy.

## (8) Comment(s)

ABHIJEET
()

use the logic given in the previous question..

i got the answer just by looking at the question

Rahul
()

3^2=9 when divides by 8 gives remainder 1

3^3=27 when divided by 8 gives remainder 3

So, when the power is even it gives 1 as remainder and when power is odd it gives 3 as remainder. So, answer is 3 as power 7 is odd.

Hope this is simple................

Gagan
()

(a+1)^n

----------- remainder is 1

a

Sravan Reddy
()

By 'Modulus' method:

$3^2 = 9\text{mod}8 = 1\text{mod}8$

Raise by power 3 on both sides,

$3^6=1\text{mod}8$

Multiply by 3 on both sides,

$3^7 = 3\text{mod}8$

So, remainder is $\textbf{3}$.

Saikat Chakraborty
()

$\dfrac{3^7}{8}= \dfrac{(3^2)^3*3}{8}= \dfrac{9^3*3}{8}$

Now, breaking it into two parts, $\dfrac{(9^3)}{8}$ and $\dfrac{3}{8}$

First $\dfrac{9^3}{8}= \dfrac{1^3}{8}= \text{Rem (1)}$

Second $\dfrac{3}{8}= \text{Rem(3)}$

So, remainder is $3*1=3.$

Shobia
()

$3^7=2187$

it is divided by 8 means $2^3$ which means last divide last 3 digit from the answer.

so, $\dfrac{187}{8}$ we wil get the remainder 3..

ans: 3

Shobhit
()

See the easiest way

when you divide $3^n$ by 8. You will get alternate remainders 1,3,1,3,1,3,1,3 and so on starting from 9.

eg. you divide $3^2$ by 8 you get 1.

you divide $3^3$ by 8 you get 3.

you divide $3^4$ by 8 you again get 1 and so on.

this 1,3,1,3,1,3 goes on.

so for 3$^7$ ans will be 3.

Gannu
()

Try this...

remainder when $\dfrac{a^n}{b}$ can be written as

if $n$ can be broken into $n=P+Q+R$;

then

the whole remainder is

$\left(\dfrac{a{^P} }{ b}\right) \times \left(\dfrac{a^Q}{b}\right) \times \left(\dfrac{a^R }{b}\right)$

which is the product of all remainders

so $3^7$ is

$3^{2+2+3}$

which is

$3^2 \times 3^2 \times 3^3$

when divide by 8 the remainders are

$1,1,3$

total remainder is $1\times 1\times 3 =3;$

i have taken $7=2+2+3$ as

$3^2$ is more than 8

decomposed into simple values....