« first day (1289 days earlier)      last day (246 days later) » 

5:34 AM
I think I have 27 bytes
 
6:00 AM
Nice!
 
6:49 AM
@chrispsn Did you see @coltim’s version of generating all subsequences on the Discord channel? Comparing to this shows you’re generating more sequences than you need but of course all’s fair in a golf. Mine generated more than I need too. I was just making an observation.
 
 
6 hours later…
12:57 PM
@doug I did see it - for this problem there might be a way of calculating the pair of numbers (length and offset) more directly, which would be more efficient (I doubt shorter but who knows) - will post if I come up with anything...
 
 
10 hours later…
10:39 PM
this should do it more efficiently but requires lots of work to golf down:
f:{b:1+!x                       / lengths
   a:x{-1+(-y)!x-+/!y}'b        / offsets
   pairs:|a,'b                  / order in descending b
   pairs:(0>*:')_pairs          / filter out -ve offsets
   i:({x=+/y+1+!z}[x].'pairs)?1 / index of first match
   {x+1+!y}/pairs i}            / generate sequence
 
11:08 PM
actually, this is better:
f:{b:1+!x                    / lengths
   a:x{-1+(x-+/!y)%y}'b      / offsets
   pairs:|a,'b               / order in descending b
   pairs@:&{x=0|_x}@*'pairs  / keep only natural numbers
   {x+1+!y}/_*pairs}         / generate sequence
 

« first day (1289 days earlier)      last day (246 days later) »