Skip to main content
deleted 47 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38

Clean, 397 373 345 339 331 320... 317 bytes

import StdEnv,StdLib
c=length
f c m=sortBy c o flatten o map m
%n=f(>)@[2..n]
@1=[]
@n#f=[i\\i<-[2..n]|n rem i<1&&and[i rem j>0\\j</i*i==n&&and[i/j*j<i\\j<-[2..i-1]]]
=f++ @(n/prod f)
?l=group(f(>)%l)
$l=hd(f(\a b=c a<c b)(~(?l))[0..sum l])
~[]_=[[]]
~i n=[[m:k]\\m<-take n[hd(i!!0++[0])..],k<- ~[drop(c a)b\\a<-group(%m)&b<-i|b>a]n|i== ?[m:k]]

Try it online!Try it online!

This takes an [Int], determines the prime factors of the result, and reduces over the factors to find the smallest representation, using the largest factor at any stage as a baseline value for the next factorial term. It won't complete some test cases on TIO, but it is fairly* fast, and can run them all in under 3 minutes on a midrange laptop.

* for an O((prod(N)!)^sum(N)) complexity algorithm

Clean, 397 373 345 339 331 320 bytes

import StdEnv,StdLib
c=length
f c m=sortBy c o flatten o map m
%n=f(>)@[2..n]
@1=[]
@n#f=[i\\i<-[2..n]|n rem i<1&&and[i rem j>0\\j<-[2..i-1]]]
=f++ @(n/prod f)
?l=group(f(>)%l)
$l=hd(f(\a b=c a<c b)(~(?l))[0..sum l])
~[]_=[[]]
~i n=[[m:k]\\m<-take n[hd(i!!0++[0])..],k<- ~[drop(c a)b\\a<-group(%m)&b<-i|b>a]n|i== ?[m:k]]

Try it online!

This takes an [Int], determines the prime factors of the result, and reduces over the factors to find the smallest representation, using the largest factor at any stage as a baseline value for the next factorial term. It won't complete some test cases on TIO, but it is fairly* fast, and can run them all in under 3 minutes on a midrange laptop.

* for an O((prod(N)!)^sum(N)) complexity algorithm

Clean, 397 ... 317 bytes

import StdEnv,StdLib
c=length
f c m=sortBy c o flatten o map m
%n=f(>)@[2..n]
@1=[]
@n#f=[i\\i<-[2..n]|n/i*i==n&&and[i/j*j<i\\j<-[2..i-1]]]
=f++ @(n/prod f)
?l=group(f(>)%l)
$l=hd(f(\a b=c a<c b)(~(?l))[0..sum l])
~[]_=[[]]
~i n=[[m:k]\\m<-take n[hd(i!!0++[0])..],k<- ~[drop(c a)b\\a<-group(%m)&b<-i|b>a]n|i== ?[m:k]]

Try it online!

This takes an [Int], determines the prime factors of the result, and reduces over the factors to find the smallest representation, using the largest factor at any stage as a baseline value for the next factorial term. It won't complete some test cases on TIO, but it is fairly* fast, and can run them all in under 3 minutes on a midrange laptop.

* for an O((prod(N)!)^sum(N)) complexity algorithm

deleted 11 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38

Clean, 397 373 345 339 331331 320 bytes

import StdEnv,StdLib
c=length
f c m=sortBy c o flatten o map m
%n=f(>)@[2..n]
^f=hd(f!!0++[0])
@1=[]
@n#f=[i\\i<-[2..n]|n rem i<1&&and[i rem j>0\\j<-[2..i-1]]]
=f++ @(n/prod f)
?l=group(f(>)%l)
$l=hd(f(\a b=c a<c b)(~(?l))[0..sum l])
~[]_=[[]]
~i n=[[^i+mn=[[m:k]\\m<-[0take n[hd(i!!0++[0])..n]],k<- ~[drop(c a)b\\a<-group(%(^i+m)%m)&b<-i|b>a]n|i== ?[^i+m[m:k]]

Try it online!Try it online!

This takes an [Int], determines the prime factors of the result, and reduces over the factors to find the smallest representation, using the largest factor at any stage as a baseline value for the next factorial term. It won't complete some test cases on TIO, but it is fairly* fast, and can run them all in under 3 minutes on a midrange laptop.

* for an O((prod(N)!)^sum(N)) complexity algorithm

Clean, 397 373 345 339 331 bytes

import StdEnv,StdLib
c=length
f c m=sortBy c o flatten o map m
%n=f(>)@[2..n]
^f=hd(f!!0++[0])
@1=[]
@n#f=[i\\i<-[2..n]|n rem i<1&&and[i rem j>0\\j<-[2..i-1]]]
=f++ @(n/prod f)
?l=group(f(>)%l)
$l=hd(f(\a b=c a<c b)(~(?l))[0..sum l])
~[]_=[[]]
~i n=[[^i+m:k]\\m<-[0..n],k<- ~[drop(c a)b\\a<-group(%(^i+m))&b<-i|b>a]n|i== ?[^i+m:k]]

Try it online!

This takes an [Int], determines the prime factors of the result, and reduces over the factors to find the smallest representation, using the largest factor at any stage as a baseline value for the next factorial term. It won't complete some test cases on TIO, but it is fairly* fast, and can run them all in under 3 minutes on a midrange laptop.

* for an O((prod(N)!)^sum(N)) complexity algorithm

Clean, 397 373 345 339 331 320 bytes

import StdEnv,StdLib
c=length
f c m=sortBy c o flatten o map m
%n=f(>)@[2..n]
@1=[]
@n#f=[i\\i<-[2..n]|n rem i<1&&and[i rem j>0\\j<-[2..i-1]]]
=f++ @(n/prod f)
?l=group(f(>)%l)
$l=hd(f(\a b=c a<c b)(~(?l))[0..sum l])
~[]_=[[]]
~i n=[[m:k]\\m<-take n[hd(i!!0++[0])..],k<- ~[drop(c a)b\\a<-group(%m)&b<-i|b>a]n|i== ?[m:k]]

Try it online!

This takes an [Int], determines the prime factors of the result, and reduces over the factors to find the smallest representation, using the largest factor at any stage as a baseline value for the next factorial term. It won't complete some test cases on TIO, but it is fairly* fast, and can run them all in under 3 minutes on a midrange laptop.

* for an O((prod(N)!)^sum(N)) complexity algorithm

added 31 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38

Clean, 397 373 345 339 307331 bytes

import StdEnv,StdLib
c=length
f c m=sortBy(>) c o flatten o map m
%n=f@[2%n=f(>)@[2..n]
^f=hd(f!!0++[0])
@1=[]
@n#f=[i\\i<-[2..n]|n rem i<1&&and[i rem j>0\\j<-[2..i-1]]]
=f++ @(n/prod f)
?l=group(f%lf(>)%l)
$l=hd(f(\a b=c a<c b)(~(?l))[0..sum l])
~[]_=[[]]
~i n#j= ^i+n
=[[jn=[[^i+m:k]\\m<-[0..n],k<- ~[drop(c a)b\\a<-group(%j%(^i+m))&b<-i|b>a]m|i==i|b>a]n|i== ?[j[^i+m:k]]

Try it online!Try it online!

This takes an [Int], determines the prime factors of the result, and reduces over the factors to find the smallest representation, using the largest factor at any stage as a baseline value for the next factorial term. It won't complete some test cases on TIO, but it is fairly* fast, and can run them all in under 3 minutes on a midrange laptop.

* for an O((prod(N)!)^sum(N)) complexity algorithm

Clean, 397 373 345 339 307 bytes

import StdEnv,StdLib
c=length
f m=sortBy(>)o flatten o map m
%n=f@[2..n]
^f=hd(f!!0++[0])
@1=[]
@n#f=[i\\i<-[2..n]|n rem i<1&&and[i rem j>0\\j<-[2..i-1]]]
=f++ @(n/prod f)
?l=group(f%l)
$l=hd(f(~(?l))[0..sum l])
~[]_=[[]]
~i n#j= ^i+n
=[[j:k]\\m<-[0..n],k<- ~[drop(c a)b\\a<-group(%j)&b<-i|b>a]m|i== ?[j:k]]

Try it online!

This takes an [Int], determines the prime factors of the result, and reduces over the factors to find the smallest representation, using the largest factor at any stage as a baseline value for the next factorial term. It won't complete some test cases on TIO, but it is fairly* fast, and can run them all in under 3 minutes on a midrange laptop.

* for an O((prod(N)!)^sum(N)) complexity algorithm

Clean, 397 373 345 339 331 bytes

import StdEnv,StdLib
c=length
f c m=sortBy c o flatten o map m
%n=f(>)@[2..n]
^f=hd(f!!0++[0])
@1=[]
@n#f=[i\\i<-[2..n]|n rem i<1&&and[i rem j>0\\j<-[2..i-1]]]
=f++ @(n/prod f)
?l=group(f(>)%l)
$l=hd(f(\a b=c a<c b)(~(?l))[0..sum l])
~[]_=[[]]
~i n=[[^i+m:k]\\m<-[0..n],k<- ~[drop(c a)b\\a<-group(%(^i+m))&b<-i|b>a]n|i== ?[^i+m:k]]

Try it online!

This takes an [Int], determines the prime factors of the result, and reduces over the factors to find the smallest representation, using the largest factor at any stage as a baseline value for the next factorial term. It won't complete some test cases on TIO, but it is fairly* fast, and can run them all in under 3 minutes on a midrange laptop.

* for an O((prod(N)!)^sum(N)) complexity algorithm

added 20 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading
added 2 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading
deleted 15 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading
deleted 25 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading