1A prescribed code or rubric, such as a spoken incantation or recipe for a potion, supposed to produce effects by or as if by magic.
2A word or phrase which has assumed great influence or significance, especially as the embodiment of a principle or doctrine; a watchword, a byword.
3A simply accomplished and highly effective means to a desired end, especially (frequently in negative constructions) an expedient solution to a problem; a panacea.
Late 19th century; earliest use found in John Fiske (1842–1901). From magic + formula.