So, I've encountered this problem and solved it using the hombo bombo technique. If you're not familiar with the topic, it's a technique I use to solve pretty much any math problem: 1- brute force the answer. 2- Try to find any patterns.
However, I felt this problem is different. Here's what I did:



