12,349,169 members (71,846 online)

# Algorithms

 Re: I know, CPallini3-Jul-08 0:11 CPallini 3-Jul-08 0:11
 Re: I know, sumit70343-Jul-08 0:28 sumit7034 3-Jul-08 0:28
 Re: I know, cp98763-Jul-08 0:52 cp9876 3-Jul-08 0:52
 Re: I know, CPallini3-Jul-08 0:56 CPallini 3-Jul-08 0:56
 Re: I know, sumit70343-Jul-08 1:36 sumit7034 3-Jul-08 1:36
 Re: I know, CPallini3-Jul-08 0:53 CPallini 3-Jul-08 0:53
 Re: NORMSDIST function 73Zeppelin3-Jul-08 2:11 73Zeppelin 3-Jul-08 2:11
 Re: NORMSDIST function CPallini3-Jul-08 2:29 CPallini 3-Jul-08 2:29
 Re: NORMSDIST function 73Zeppelin3-Jul-08 3:19 73Zeppelin 3-Jul-08 3:19
 Re: NORMSDIST function sumit70343-Jul-08 2:47 sumit7034 3-Jul-08 2:47
 Re: NORMSDIST function Member 82494620-Dec-11 23:54 Member 824946 20-Dec-11 23:54
 The six rightmost non-zero digits of 1000000! Rod Gowdy2-Jul-08 4:50 Rod Gowdy 2-Jul-08 4:50
 Re: The six rightmost non-zero digits of 1000000! [modified] Robert.C.Cartaino2-Jul-08 6:33 Robert.C.Cartaino 2-Jul-08 6:33
 The last six non-zero digits of 1,000,000! are 412544. Please, keep your money. I wrote this code to calculate your answer: ```// Calculate the least significant (non-zero) digits of large factorials. // By Robert C. Cartaino // Posted via http://www.codeproject.com // 02-July-2008 using System;   class Program { const ulong Target = 1000000; // This is the number you are trying to find the factorial of. const ulong RoundOff = 10000000000; // This rounds off the answer so the intermediate results don't overflow. static void Main(string[] args) { ulong factorial = 1;   // Iterate through all numbers up to 'Target', multiply by each to find the factorial of 'Target'. for (ulong n = 1; n <= Target; n++) { factorial *= n;   // Remove the trailing zeros. while (factorial % 10 == 0) { factorial /= 10; }   // We only need the right-most digits. factorial %= RoundOff;   //Console.WriteLine("{0}! = {1}", n, factorial); }   Console.WriteLine("{0}! (truncated) = {1}", Target, factorial); } }``` Why it works: When multiplying numbers, the trailing zeros at the end will not change the outcome... so I threw those out. Also, if you are only interested in the least significant digits, then the upper-most digits will not have an effect on the outcome of the lower digits... so I threw those out. With all the rounding, I didn't have to worry about overflow so I was able to calculate the "truncated factorials" of very large numbers iteratively. Enjoy, Robert C. Cartaino modified on Wednesday, July 2, 2008 1:26 PM
 Re: The six rightmost non-zero digits of 1000000! Rod Gowdy3-Jul-08 3:42 Rod Gowdy 3-Jul-08 3:42
 Re: The six rightmost non-zero digits of 1000000! Robert.C.Cartaino3-Jul-08 10:06 Robert.C.Cartaino 3-Jul-08 10:06
 Specify numbers as product of Primes? Ian Uy25-Jun-08 19:37 Ian Uy 25-Jun-08 19:37
 Re: Specify numbers as product of Primes? cp987625-Jun-08 21:32 cp9876 25-Jun-08 21:32
 Re: Specify numbers as product of Primes? Ian Uy26-Jun-08 0:42 Ian Uy 26-Jun-08 0:42
 Re: Specify numbers as product of Primes? Robert.C.Cartaino26-Jun-08 4:48 Robert.C.Cartaino 26-Jun-08 4:48
 Re: Specify numbers as product of Primes? Ian Uy26-Jun-08 4:50 Ian Uy 26-Jun-08 4:50
 Re: Specify numbers as product of Primes? The Developer8-Aug-08 7:03 The Developer 8-Aug-08 7:03
 Re: Specify numbers as product of Primes? Ian Uy26-Jun-08 6:28 Ian Uy 26-Jun-08 6:28
 Re: Specify numbers as product of Primes? Paul Conrad28-Jun-08 5:44 Paul Conrad 28-Jun-08 5:44
 Re: Specify numbers as product of Primes? Ian Uy28-Jun-08 5:46 Ian Uy 28-Jun-08 5:46
 Re: Specify numbers as product of Primes? Paul Conrad28-Jun-08 6:11 Paul Conrad 28-Jun-08 6:11
 Re: Specify numbers as product of Primes? Ravi Bhavnani8-Aug-08 7:16 Ravi Bhavnani 8-Aug-08 7:16
 Re: Specify numbers as product of Primes? cp987628-Jun-08 20:27 cp9876 28-Jun-08 20:27
 Re: Specify numbers as product of Primes? Luc Pattyn29-Jun-08 2:42 Luc Pattyn 29-Jun-08 2:42
 Re: Specify numbers as product of Primes? MarkBrock27-Jun-08 18:46 MarkBrock 27-Jun-08 18:46
 Re: Specify numbers as product of Primes? Paul Conrad28-Jun-08 5:42 Paul Conrad 28-Jun-08 5:42
 Re: Specify numbers as product of Primes? ChandraRam2-Jul-08 22:49 ChandraRam 2-Jul-08 22:49
 Re: Specify numbers as product of Primes? MarkBrock2-Jul-08 23:06 MarkBrock 2-Jul-08 23:06
 Re: Specify numbers as product of Primes? Member 419459326-Jun-08 8:19 Member 4194593 26-Jun-08 8:19
 Re: Specify numbers as product of Primes? Robert.C.Cartaino26-Jun-08 8:47 Robert.C.Cartaino 26-Jun-08 8:47
 Re: Specify numbers as product of Primes? Ian Uy26-Jun-08 17:51 Ian Uy 26-Jun-08 17:51
 Re: Specify numbers as product of Primes? cp987629-Jun-08 14:57 cp9876 29-Jun-08 14:57
 Re: Specify numbers as product of Primes? Arash Partow29-Jun-08 0:48 Arash Partow 29-Jun-08 0:48
 Re: Specify numbers as product of Primes? [modified] cp987629-Jun-08 3:53 cp9876 29-Jun-08 3:53
 Re: Specify numbers as product of Primes? Luc Pattyn29-Jun-08 4:40 Luc Pattyn 29-Jun-08 4:40
 Re: Specify numbers as product of Primes? cp987629-Jun-08 14:47 cp9876 29-Jun-08 14:47
 Re: Specify numbers as product of Primes? Arash Partow30-Jun-08 2:54 Arash Partow 30-Jun-08 2:54
 Re: Specify numbers as product of Primes? cp987630-Jun-08 3:18 cp9876 30-Jun-08 3:18
 Re: Specify numbers as product of Primes? Arash Partow30-Jun-08 4:27 Arash Partow 30-Jun-08 4:27
 Re: Specify numbers as product of Primes? Arash Partow30-Jun-08 2:17 Arash Partow 30-Jun-08 2:17
 logic of prob function in ms excel sumit703425-Jun-08 0:40 sumit7034 25-Jun-08 0:40
 Factorials Ian Uy24-Jun-08 8:17 Ian Uy 24-Jun-08 8:17
 Re: Factorials Tim Craig24-Jun-08 10:29 Tim Craig 24-Jun-08 10:29
 Re: Factorials Ian Uy25-Jun-08 6:32 Ian Uy 25-Jun-08 6:32
 Re: Factorials Tim Craig25-Jun-08 8:55 Tim Craig 25-Jun-08 8:55
 Last Visit: 31-Dec-99 18:00     Last Update: 24-Jun-16 23:49 Refresh « Prev1...74757677787980818283 Next »