I recall once reading a series of short stories where any sort of calculation would summon demons or perform other magic. The main character was an investigator of some sort, and his boss was (secretly) a summoned and geased demon. What universe did this take place in?
It may be Charles Stross' Laundry Files series. The series, which consists of novels, short-stories and novellas, is based on the very Lovecraftian idea of crossing magic and mathematics. The main character, Bob Howard, is an agent of a secret British agency that is charged with investigating and controlling the magical results of certain higher mathematical functions. There are hints in the earlier stories that Bob's boss is something other than strictly human. The novel The Fuller Memorandum goes into more detail on his boss' nature.