in reply to Re^2: Spreading out the elements
in thread Spreading out the elements

There isn't much of an algorithm, really. There are na-1 slots into which the B's will go. In the general case, some slots will have
floor( nb / (na-1) )
B's and others will have one more. Still, it took me more than an hour from start to finish. Cheers.