calculating number of possible peptides for given mass using memoized recursive function