3/28/2025 at 5:56:53 PM
Edit: as pointed out, you can't simply divide by each number, because then its not equal to original number factorial. However, I've fixed the algorithm somewhat maintaining the basic ideaThe "naive" way
100!= 2*3*4*...*99*100
Obviously t(100) > 1. If we can get rid of the single 2, we know that t(100) > 2. If you multiply the whole thing by 2/2 (=1), 100! = (2/2)*2*3*4*...*50*...99*100
= (2*2/2)*3*4*...*50*...99*100
= (4/2)*3*4*...*50*...99*100
= 4*3*4*...*50*...99*(100/2)
= 3*4*4*...*50*50*...99
We can continue with t(100) > 3 by multiplying by 3/3 and pairing it with 99, i.e. 99*3*(3/3) = (99/3)*3*3 = 33*9 yielding 100! = 4*4*5*...*9*9*10*..*33*33*...*50*50...*97*98
However, once we get to t(100) > 4, trying to get rid of 4, we have to skip 98 since its not divisible by 4. The other problem is we have two 4s... If we had instead using 98 for getting rid of 2, we can then use 100, and 96 for the other 4. This is our first "gotcha" for the naive algorithm of always picking the largest number, which seems intuitive at first glance.Now if we test all possibilities starting with 2, we get 48 choices for the dividing 2 (even numbers > 2, not including 2 which will not increase t(100) beyond 2. Then ~33 choices for dividing 3 (depending if our div of 2 resulted in a factor of 3), ~25 for 4, But notice since we now have two 4s, we have to do it twice, so its 25*24 choices for getting rid of 4.*
by SJC_Hacker
3/28/2025 at 6:47:41 PM
The naive way has to have a 1 in it since what you give only has 99 factors.by dudinax
3/28/2025 at 7:11:21 PM
> 100 = 3*4*...*50*50*...99You can’t replace 2*100 with 50, it has to be 4*50. But there’s no reason you have to divide by 2 at all - why not replace 2*99 with 6*33?
by pansa2
3/28/2025 at 7:54:06 PM
Thanks, I've fixed the ideaThe basic idea is to "pair" the lowest numbers with the highest ones - sort of pushing everything towards the middle values
Like I said, its naive greedy and non-optimal - otherwise time would be linear.
by SJC_Hacker