In Russia (at least in my town) we have bus tickets with 6 digits from 0 to 9. A ticket is considered "lucky" if the sum of its first 3 digits is equal to the sum of the last 3.
Is there any formula to calculate the amount of lucky tickets? I know I can just use brute force and calculate it on a computer with a for-loop, but I want more elegant solution.