So, I read a book back in the dark ages, when I was a kid. (For all of you who are older than me, I just made you feel old. Sorry.) It featured, I think, a guinea pig (possibly a tortoise?) who could do magic by completing a magic square - a particular sort of math game, in which all the numbers in the grid had to add up to the same number at the end of each row or column. If she managed to make all the numbers work out properly, her spells worked properly; but if (as was often the case) she was off in her math somewhere, the spells went amusingly wrong.
The bigger kid is doing magic square type math things right now, and I thought it would be fun to give her this book to read - but I can't remember what the title is, or the author, or even if it's a guinea pig or a tortoise who did the magic squares. Help?