answered 13 years ago
Does the \sage command do what you want?
\sage
%latex Did you know that $20! = \sage{factorial(20)}$?