News for hackers. Stuff that matters.
Re:Decomposing a Factorial into Large Factors by tempodox on Friday March 28, 2025 @01:08PM (#43507784)
I'm still confused as to how to compute t(N). Maybe it's buried in the legalese of this text and I'm just dumb, but I can't find a clue.
Re:Decomposing a Factorial into Large Factors by btilly on Friday March 28, 2025 @01:32PM (#43508025)
You factor N! into N factors, and look at the smallest of those factors. t(N) is the largest that the smallest factor can be. Here are the best factorizations going slightly beyond the part of https://oeis.org/A034258 that was quoted by Terry Tao.

  1! =  1
  2! =  1 * 2
  3! =  1 * 2 * 3
  4! =  2 * 2 * 2 * 3
  5! =  2 * 2 * 2 * 3 * 5
  6! =  2 * 2 * 3 * 3 * 4 * 5
  7! =  2 * 2 * 3 * 3 * 4 * 5 * 7
  8! =  2 * 3 * 3 * 4 * 4 * 4 * 5 * 7
  9! =  3 * 3 * 3 * 4 * 4 * 4 * 5 * 6 * 7
  10! = 3 * 3 * 4 * 4 * 4 * 5 * 5 * 6 * 6 * 7
  11! = 3 * 3 * 4 * 4 * 4 * 5 * 5 * 6 * 6 * 7 * 11
  12! = 3 * 4 * 4 * 4 * 5 * 5 * 6 * 6 * 6 * 6 *  7 * 11
  13! = 3 * 4 * 4 * 4 * 5 * 5 * 6 * 6 * 6 * 6 *  7 * 11 * 13
  14! = 4 * 4 * 4 * 5 * 5 * 6 * 6 * 6 * 6 * 6 *  7 *  7 * 11 * 13
  15! = 4 * 5 * 5 * 5 * 6 * 6 * 6 * 6 * 6 * 6 *  7 *  7 *  8 * 11 * 13
  16! = 5 * 5 * 5 * 6 * 6 * 6 * 6 * 6 * 6 * 7 *  7 *  8 *  8 *  8 * 11 * 13
Re:Decomposing a Factorial into Large Factors by vintermann on Friday March 28, 2025 @02:15PM (#43508439)
Is the number of factors when you write it out this way, always one more than the previous?

EDIT: Never mind, that's part of the definition of the problem!

Re:Decomposing a Factorial into Large Factors by yorwba on Friday March 28, 2025 @01:29PM (#43507987)
If you don't need it to be fast, the naive way to implement "the largest quantity such that it is possible to factorize N! into N factors a_1, ..., a_N, each of which is at least t(N)" is

  import math
  factorize = lambda N, number_of_factors: [(factor,) + rest for factor in range(1, N+1) if N % factor == 0 for rest in factorize(N//factor, number_of_factors-1)] if number_of_factors > 1 else [(N,)]
  t = lambda N: max(min(factors) for factors in factorize(math.factorial(N), N))
Re:Decomposing a Factorial into Large Factors by teraflop on Friday March 28, 2025 @01:22PM (#43507925)
The straightforward but slow way is to just brute-force over all possible factorizations of N!.

As the post states, writing N! as a product of factors is equivalent to writing log(N!) as a sum of those factors' logarithms. So log(t(N)) is the smallest bin size such that the factors all "fit" into N bins of that size.

This computation is simple to describe and implement, it's just inefficient because there's a combinatorial explosion of possible ways to pack factors into bins. It's an instance of the knapsack problem which is NP-complete.

Re:Decomposing a Factorial into Large Factors by vintermann on Saturday March 29, 2025 @11:46AM (#43516404)
It's a subset of the knapsack problem though, so there may well be some shortcut to solving it that doesn't let us solve arbitrary knapsacks.
Re:Decomposing a Factorial into Large Factors by teraflop on Sunday March 30, 2025 @02:17PM (#43526275)
Right, I was just trying to clarify because the OP was asking for a way to compute the function. It may not be the best way, and that's the interesting open question.