If your invention produces a useful and measurable result you can obtain a patent protection right for it. Note, you can get patent protection for an application that is operating using a mathematical formula, but you can’t get protection for the formula itself.