6 digit numbers no repetitions with equal part sums

75 Views Asked by At

I am interested in six digit numbers where the sum of the first digits numbers is equal to the last three digits but no digit repeats.

Examples:

  • $143260$ (since $1+4+3=2+6+0$)
  • $091325$ (since $0+9+1=3+2+5$).

What is the largest number of numbers I should observe that assures me it contains at least one number with this property? In other words, if I am at any $6$ digit number (with or without this property) after how many numbers can I be sure that the number with this property is reached at?

Example: Consider I am at the number $000001$. Then the next number with this property will only be $018,234$. Or, I would have to "wait" for $18,234$ more numbers to pass by. By a computer code, we can show that actually 18,234 is the maximum number of such waitings I need no matter where I start from! How can I derive this without a computer?

Side note: This problem is related to the famous Lucky Ticket problems. The difference is that Lucky Tickets allow repeated digits. There one can easily derive that 1,001 tickets are required to be brought which ensure a Lucky Ticket is with you.

1

There are 1 best solutions below

0
On

Here's an approach that still requires technology but uses some reasoning to reduce the number of 6-tuples you need to search.

The numbers you need are reorderings length 6 partitions of $n$ with distinct parts (each 0 through 9) with the additional condition that some 3 parts have the same sum as the other 3 parts. The additional condition means that $n$ must be even. The $n$ to consider are $16, 18, \dots, 38$ arising from $(6,4,3,2,1,0)$ up to $(9,8,7,6,5,3)$.

The Mathematica code

Table[Select[IntegerPartitions[n], Max[Length /@ Split@ #] == 1 
&& Length[#] == 5 && First[#] <= 9 &], {n, 16, 38, 2}]

and its analogue for length 6 show that there are exactly 100 partitions to consider (the Max-Length-Split command is provided in the Wolfram documentation as a way to count distinct part partitions).

For each partition, after you find a separation into two 3-part partitions with the same sum, the numbers can be ordered in $2(3!)^2 = 72$ ways. Or, rather than find the split, it might be computationally more efficient just to check the $6! = 720$ orderings. Either way, then order the 7200 numbers and find the maximum first difference.