The key rotating part was crazy, the first time I thought it was a joke and after failing it a bunch I made a recording and watched it in slow motion to solve it. For anyone who wants the answer, it is key number ((7^3)/20)-14 rounded down.
thank you. my ability to follow paterns may suck but i can do this