fork(1) download
  1. f 1=[1]
  2. f n|x<-f$n-1=last[k|k<-[1..n],p<-[1..n],k*p<n,take(k*p)x==([1..k]>>take p x)]:x
  3.  
  4. main = print $ g 30
Success #stdin #stdout 0s 4696KB
stdin
Standard input is empty
stdout
[1,1,2,1,1,2,2,2,3,1,1,2,1,1,2,2,2,3,2,1,1,2,1,1,2,2,2,3,1,1]