You are given a number of digits in number n, n is always even. You have to count a number of numbers with n digits in which sum of first half digits is equal to sum of other half digits.
For example in number 276087,
2+7+6 = 0+8+7 = 15
It’s easy to make an algorithm that counts all possible combinations, but what I wanted to do is to make a formula that could do it, and it turned out to be really hard for me, I only found ready formula that works but I can’t understand how.
So the question is how to make this formula?
(Sorry for possible mistakes, English is not my native language)