Wait, mathematical functions are patentable!?
In no country I guess. You have to transform your idea in something more concrete first. A piece of hardware, a process, a composition of matter you name it.
Imagine all those stupid ideas from just lying in the bed and thinking about being patented. Nothing would have been created but everything would have been patented. That's worse than patenting a formula or a piece of software.
It appears that USPTO has issued it several times [0]:
6505576 Pet Toy
6557495 Laser Pet Toy
6651591 Automatic laser pet toy and exerciser
6701872 Method and apparatus for automatically exercising a curious animal
[0] http://www.freepatentsonline.com/crazy.htmlWhether it'll stick once someone challenges it is another question.