
Shortcut Trick
Using Fermat's Little Theorem: ap−1 ≡ 1 (mod p) for any prime p.
Here p = 7, so 36 ≡ 1 (mod 7).
We can write 38 = 36 × 32.
So, 38 ≡ 1 × 9 ≡ 9 (mod 7).
When 9 is divided by 7, the remainder is 2.
∴ The correct answer is 2.

Alternate Method
Given:
Expression: 38 ÷ 7
Concept Used:
Properties of remainders: (A × B) mod N = [(A mod N) × (B mod N)] mod N
Calculation:
⇒ The given expression 38 can be written as (32)4.
⇒ (32)4 = 94
⇒ Find the remainder when the base 9 is divided by 7.
⇒ 9 ÷ 7 leaves a remainder of 2.
⇒ Now, replace 9 with its remainder in the original power expression: 24
⇒ 24 = 16
⇒ Finally, divide 16 by 7 to get the final remainder.
⇒ 16 = 7 × 2 + 2
⇒ The remainder is 2.
∴ The correct answer is 2.

Additional Information
Fermat's Little Theorem
It states that if p is a prime number, then for any integer a, the number ap−1 − 1 is an integer multiple of p. The formula is expressed as ap−1 ≡ 1 (mod p).
Euler's Totient Theorem
It generalizes Fermat's theorem, stating aφ(n) ≡ 1 (mod n) where a and n are coprime, and φ(n) represents Euler's totient function.
Successive Squaring Concept
Large powers can be calculated efficiently by repeatedly squaring the base and taking the remainder at each step to keep the numbers small and manageable.