Computing end-digits of large factorials

In summary, the conversation is about finding the five digits that come before the trailing zeros in the factorial of 1 trillion. The speaker knows how to calculate the number of trailing zeros, but is unsure of what to do afterwards. They also discuss the difference between 10^12 and 10^18 and how it may affect the final five non-zero digits. The speaker also mentions a formula for calculating the number of trailing zeros and expresses uncertainty about the next step in the process.
  • #1
PhDorBust
143
0
The factorial of 1 trillion ends in many trailing zeros. Find the five digits that comes before the trailing zeros.

I know how to calculate the number of trailing zeros, but don't know what to do afterwards. This is a computational problem.
 
Physics news on Phys.org
  • #2
PhDorBust said:
The factorial of 1 trillion ends in many trailing zeros. Find the five digits that comes before the trailing zeros.

I know how to calculate the number of trailing zeros, but don't know what to do afterwards. This is a computational problem.

One trillion could be either 10^12 or 10^18, depending on where you reside. Which one do you mean? See http://en.wikipedia.org/wiki/Trillion .

RGV
 
  • #3
10^12, sorry.

Should it make a difference though?
 
  • #4
PhDorBust said:
10^12, sorry.

Should it make a difference though?

It will make a huge difference. But, it may not make a difference in the final 5 non-zero digits.

Do you know how many trailing zeros there are in (1012)! ?
 
Last edited:
  • #5
Let a = 10^12, b = n be largest n such that a/5^n is an integer.

Number of trailing zeros will be N = a/5 + a/(5^2) + a/(5^3) + ... a/(5^n) = a/(5^n) * (1 + 5 + 5^2 + ... + 5^(n-1) ) = a/(5^n) * [ 5^n - 1] / [5 - 1].

But (10^12)! / 10^N is still pretty damn large to calculate. I don't see the next step.
 

What is the purpose of computing end-digits of large factorials?

The purpose of computing end-digits of large factorials is to determine the last few digits of a factorial number, which can be useful in a variety of mathematical and scientific applications. It can also help in understanding the patterns and properties of factorial numbers.

What is considered a large factorial number?

In general, any factorial number that has more than 100 digits is considered a large factorial number. However, the exact cutoff for what is considered "large" may vary depending on the specific application and computing capabilities.

What is the most efficient method for computing end-digits of large factorials?

The most efficient method for computing end-digits of large factorials is to use modular arithmetic. This involves taking the remainder of the factorial number when divided by a smaller number, such as 10, to determine the last digit(s).

What are some potential challenges when computing end-digits of large factorials?

Some potential challenges when computing end-digits of large factorials include the time and computing resources required, as well as the potential for overflow or underflow errors. Additionally, some factorial numbers may not follow predictable patterns, making it more difficult to determine the end-digits with accuracy.

How can computing end-digits of large factorials be applied in real-world scenarios?

Computing end-digits of large factorials can be used in cryptography, where large factorials are often used in encryption algorithms. It can also be used in statistical analysis and probability calculations, as well as in various scientific fields such as physics and chemistry where large numbers are often encountered.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
308
  • Introductory Physics Homework Help
Replies
11
Views
816
  • General Math
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
32
Views
2K
Replies
4
Views
844
  • General Math
Replies
5
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
397
Replies
8
Views
2K
  • General Math
Replies
11
Views
1K
Replies
2
Views
2K
Back
Top