Counting happy tickets with given number of digits

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)

submitted by /u/aliencup
[link] [comments]

Published by

Nevin Manimala

Nevin Manimala is interested in blogging and finding new blogs

Leave a Reply

Your email address will not be published. Required fields are marked *