After an algorithm by E. Bjorklund. See paper by Godfried Toussaint.
k |
The number of 'hits'. |
n |
The total array size. |
Bjorklund(3, 8) //tresillo Bjorklund(5, 8) //cinquillo Bjorklund(9, 16) //rumba //--also works with symbols and other objects Bjorklund.fromArray([\a, \a, \a, \b, \b, \b, \b, \b])
see Pbjorklund for more examples.