If \(5^x-3^y=13438\) and \(5^{x-1}+3^{y+1}=9686,\) then \(x+y\) equals?
Simplify the equation: \[ 5x - 1 + 3^y + 1 = 9686 \Rightarrow 5x + 3^y = 9686 \]
For all positive integers \(x\), the term \(5x\) will end in either 0 or 5. Since we want the unit digit of the sum \(5x + 3^y\) to be 6 (as 9686 ends with 6), we check possible unit digits of \(3^y\).
The unit digit of powers of 3 cycles every 4: \[ 3^1 = 3,\quad 3^2 = 9,\quad 3^3 = 27,\quad 3^4 = 81 \Rightarrow \text{Cycle: } 3, 9, 7, 1 \] So, the unit digit of \(3^y\) depends on \(y \mod 4\): \[ y \equiv 1 \Rightarrow 3,\quad y \equiv 2 \Rightarrow 9,\quad y \equiv 3 \Rightarrow 7,\quad y \equiv 0 \Rightarrow 1 \] Since the last digit of 9686 is 6, only the combination \(5x \text{ ends in } 5\) and \(3^y \text{ ends in } 1\) will satisfy the last digit being 6: \[ 5 + 1 = 6 \] So, \(3^y\) must end in 1 ⇒ \(y \equiv 0 \mod 4\)
Try \(y = 4\): \(3^4 = 81\), so: \[ 5x = 9686 - 81 = 9605 \Rightarrow x = \frac{9605}{5} = 1921 \] Try \(y = 8\): \(3^8 = 6561\) \[ 5x = 9686 - 6561 = 3125 \Rightarrow x = \frac{3125}{5} = 625 \]
One valid pair is \(x = 625,\ y = 8\)
Another is \(x = 6,\ y = 7\) (as \(5x = 30\), \(3^7 = 9686 - 30 = 9656\), but \(3^7 = 2187\), so this doesn't match)
Try \(3^y = 6561\) ⇒ \(y = 8\), then \(5x = 9686 - 6561 = 3125 \Rightarrow x = 625\)
Hence, \(x + y = 625 + 8 = \boxed{633}\)
Correct Final Answer: \(\boxed{x + y = 633}\)