nWorkersFun function

Sample a number of workers