Skip to main content
1 of 4
Michael Klein
  • 2.4k
  • 15
  • 29

#Haskell, 131 bytes

import Data.List iterate(\n->sort[x|x<-[read(concatMap show$filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n]!!0)13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

Michael Klein
  • 2.4k
  • 15
  • 29