You can't, only its application. Genicap's patent does cover application in software though.
I had to look into this regarding an algorithm we're building and whether it's patentable. If your formula is a mere scheme or method implemented in a computer, it's likely to be rejected. The following links add detail:
http://www.fisheradamskelly.com.au/2015/12/full-federal-cour...
https://en.wikipedia.org/wiki/Alice_Corp._v._CLS_Bank_Intern...
http://www.ipwatchdog.com/2016/05/13/federal-circuit-says-so...