stackd.io formula for a number of base states