AlgebrarbeglA
Challenge
78! - k = k - !87
Solve for
k
flag format isudctf{k}
Dedicated to Wrath of Math
Solution
First, I did some digging into factorials and subfactorials. I highly encourage you to watch Youtube videos from Wrath of Math that was recommended, because he explains it really well. I watched this one about subfactorials.
Now that we understand what it's all about, let's restate the equation and solve for k.
Because these are such large numbers, we will use Python to solve it for us.
import math
from sympy import subfactorial
# Calculate the factorials
factorial_78 = math.factorial(78)
factorial_87 = subfactorial(87)
# Calculate k
k = (factorial_78 + subfactorial_87) // 2 # Using integer division to ensure an integer result
# Print the result
print(k)
And we get our result !
Last updated