3^8118087567834506 mod 5 
Find extended Euclidian
Algorithm for 8118087567834506 mod 5:\n\nThe extended Euclidean algorithm is an extension of the Euclidean algorithm, which computes, besides the greatest common divisor (GCD) of integers a and b, also the coefficients of Bézout's identity, which are integers x and y such that:\n\na * x + b * y = gcd(a, b).\n\nTo find the x and y satisfying the equation for the given numbers, perform the following steps:\n\n1. Initialize:\n   - Remainder r0 = 8118087567834506, r1 = 5\n   - Coefficients x0 = 1, y0 = 0\n   - Coefficients x1 = 0, y1 = 1\n\n2. Divide:\n   - q2 = r0 // r1 = 1623617513566901\n   - r2 = r0 % r1 = 1\n\n3. Update coefficients:\n   - x2 = x0 - q2 * x1 = 1 - 1623617513566901 * 0 = 1\n   - y2 = y0 - q2 * y1 = 0 - 1623617513566901 * 1 = -1623617513566901\n\nSince the remainder r2 is 1, which is not 0, continue the algorithm:\n\n4. Divide:\n   - q3 = r1 // r2 = 5 // 1 = 5\n   - r3 = r1 % r2 = 5 % 1 = 0\n\n5. Update coefficients:\n   - x3 = x1 - q3 * x2 = 0 - 5 * 1 = -5\n   - y3 = y1 - q3 * y2 = 1 - 5 * -1623617513566901 = 8118087567834506\n\nSince the remainder r3 is 0, the algorithm is complete.\n\nResult:\n- x = -5\n- y = 8118087567834506\n\nSo, the equation becomes:\n\n8118087567834506 * (-5) + 5 * 8118087567834506 = gcd(8118087567834506, 5)\n\nNote: In the context of modular arithmetic, x is known as the modular inverse of a modulo b, but in this specific case, the modular inverse does not exist because gcd(8118087567834506, 5) ≠ 1.