Hacker News new | ask | show | jobs
by klyrs 803 days ago
Indeed,

   [n, n-1] 
   [n-3, 3, n-1]
   [n-3, 2, 1, n-1]
   [n-3, 2, n]
   [n-1, n]
Works for all n greater than... 6?
1 comments

Optimizing self-response! That fails for six because n-3 and 3 co-occur. With a slight modification we can make it work for all n>5

  [n, n-1]
  [2, n-2, n-1]
  [2, n-3, 1, n-1]
  [2, n-3, n]
  [n-1, n]
edit: and it's not hard to show that n<6 are impossible, so the solution above is optimal in that sense.