MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Any large factorial will have a number of zero behind it, and one could write an expression to compute the number of trailing zeros, but how would one go about computing the non-zero end digits?

E.g. compute first 5 non-zero end digits of (10^12)!

share|cite|improve this question

closed as too localized by Igor Rivin, Matthew Daws, Kevin O'Bryant, Felipe Voloch, Emil Jeřábek Nov 9 '11 at 18:18

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Not a research level question, voting to close. – Igor Rivin Nov 9 '11 at 14:13
Indeed not research level, though it does lead to the $p$-adic Gamma function (here with $p=5$). – Noam D. Elkies Nov 9 '11 at 14:18
Computing the first 5 non-zero end digits of (10^12)! is Project Euler problem 160. Clearly this kind of cheating shouldn't be encouraged. – Guntram Nov 9 '11 at 16:16

This will be the least complete answer I've ever posted, but perhaps somebody else will be able to add to it. Not a complete answer (because I don't find any paper online), but I've heard Jean-Marc Deshouillers speak on his (with others, but I don't recall with whom) proof that the last non-zero base-$p$ digit of $n!$ forms a $q$-automatic sequence. I don't recall the hypothesis on $p$, nor the connection between $p$ and $q$.

But this answers (to a very limited extent) the real math-research level question hidden in this homework question. Or at least it would, if I could recall any details!

share|cite|improve this answer
What does "q-automatic" mean? – Igor Rivin Nov 9 '11 at 14:23
@Igor: there are many equivalent definitions, and the Allouche/Shallit book "Automatic Sequence" is beautifully written; I can recommend it easily for any "tourist" in the area. The wikipedia link is somewhat spartan: – Kevin O'Bryant Nov 9 '11 at 15:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.