If mr krabs gets infinite money then he wont need the formula because the goal of the formula was to make a tasty sandwich and the goal of making a tasty sandwich is to sell it and the point of selling something is usually to get money so if he has infinite money then he doesnt really need to keep it a secret