n is a digit such that the 5-digit number n878n is divisible by 9. What is the value of n?

To check if a number is divisible by 9, we need to find the sum of its digits and see if that sum is divisible by 9.

Let's apply this rule to the given number, n878n.

The sum of the digits in n878n can be expressed as:

n + 8 + 7 + 8 + n

Simplifying this expression, we get:

2n + 23

Now, to determine if this sum is divisible by 9, we need to find a value of n that makes the sum a multiple of 9.

We can start by examining the expression 2n + 23. To make this expression a multiple of 9, we need to find a value of n that satisfies the following equation:

2n + 23 = 9k

Here, k is an integer representing the number of times 9 divides the sum.

Let's try to find a value for n:

2n + 23 = 9k
2n = 9k - 23
2n = 9k - 10 - 3 - 10
2n = 9k - 20 - 3

From this equation, we can see that the right side of the equation must be divisible by 2 so that n is an integer.

By examining different values for k, we find that k = 3 satisfies the equation:

2n = 9(3) - 20 - 3
2n = 27 - 23
2n = 4
n = 2

Therefore, the value of n that makes the 5-digit number n878n divisible by 9 is 2.