Results 1 to 14 of 14

Math Help - factorial for big numbers

  1. #1
    raju
    Guest

    factorial for big numbers

    I need a way to find factorail for big numbers like 8479!

    Thanks in advance

    raju
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Global Moderator

    Joined
    Nov 2005
    From
    New York City
    Posts
    10,616
    Thanks
    9
    Quote Originally Posted by raju View Post
    I need a way to find factorail for big numbers like 8479!

    Thanks in advance

    raju
    A simple way.
    Just multiply them out.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by raju View Post
    I need a way to find factorail for big numbers like 8479!

    Thanks in advance

    raju
    See Stirlings formula (equations 13 and 14 here)

    RonL
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Global Moderator

    Joined
    Nov 2005
    From
    New York City
    Posts
    10,616
    Thanks
    9
    Quote Originally Posted by CaptainBlank View Post
    See Stirlings formula (equations 13 and 14 here)

    RonL
    That is only an approximation.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by ThePerfectHacker View Post
    That is only an approximation.
    How many digits does 8479! have?

    (Rhetorical question)

    RonL
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Eater of Worlds
    galactus's Avatar
    Joined
    Jul 2006
    From
    Chaneysville, PA
    Posts
    3,001
    Thanks
    1
    Quote Originally Posted by CaptainBlack View Post
    How many digits does 8479! have?

    (Rhetorical question)

    RonL
    Over 29,000.

    25972686487041052159869258722936182200373790277711 48344797668281885988268302193747006721558615751528[...29429 digits...]00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Global Moderator

    Joined
    Nov 2005
    From
    New York City
    Posts
    10,616
    Thanks
    9
    Quote Originally Posted by CaptainBlack View Post
    How many digits does 8479! have?

    (Rhetorical question)

    RonL
    I can find how many zeros is has .
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Member
    Joined
    Nov 2006
    Posts
    136
    i had this problems some weeks back. Stirlings function is probably the best for large factorials. But otherwise use this bit of code i wrote in java which is computationally efficient.


    public double gammaln(float xx){
    double x,y,tmp,ser;
    double[] cof={76.18009172947146,-86.50532032941677,
    24.01409824083091,-1.231739572450155,
    0.1208650973866179e-2,-0.5395239384953e-5};
    int j;
    y=x=xx;
    tmp=x+5.5;
    tmp -= (x+0.5)*Math.log(tmp);
    ser=1.000000000190015;
    for (j=0;j <= 5;j++) {ser += cof[j]/++y;}
    return -tmp+ Math.log(2.5066282746310005*ser/x);}


    public double factorial(float n){
    double value = gammaln(n + 1);
    double answer = Math.exp(value);
    return answer;}

    This is based around a method of gamma approximation by C.lanczos. (Paper is called - (A precision approximation of the gamma function).

    This method can also be used to find NON integer factorials
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Mar 2007
    Posts
    7
    I think ur asking this for a question like "find the lowest common multiple" (LCM)

    there is no need to use massive formulas unless the number is greater then 1trillion.

    just use Prime factorisation.

    eg. 4 = 2 power of 2
    6 = 3 x 2
    1001 = 7 x 11 x 13
    etc...

    take the number and find all possible prime numbers which go ito it. (see examples above)
    then...

    eg. find the lowest common multiple of 4, 2, 6
    4 = 2 squared 2 = 2 and 6 = 2x3
    therfore the number must contain 2 squared and 3.
    = 2 squared x 3
    = 12

    find all prime factors of the numbers. and take the common ones out
    eg. 2 squared and 2
    only use 2 squared because 2 is within 2 squared

    then multiply them together.


    (i can go on but it would just be useless)
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by spanner View Post
    I think ur asking this for a question like "find the lowest common multiple" (LCM)
    How does this relate to finding the factorial of a large number?

    RonL
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Newbie
    Joined
    Mar 2007
    Posts
    7
    Quote Originally Posted by CaptainBlack View Post
    How does this relate to finding the factorial of a large number?

    RonL
    it gives the base of a number in its prime factors,

    then u can use all of theose prime numbers in different combinations to find the factors
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by spanner View Post
    it gives the base of a number in its prime factors,

    then u can use all of theose prime numbers in different combinations to find the factors
    This is incomprehensible, please give us an example

    RonL
    Follow Math Help Forum on Facebook and Google+

  13. #13
    Member
    Joined
    Nov 2006
    Posts
    136
    hang on maybe some confusion. spanner were finding a method of carrying out the factorial function not the LCM. I dont see how in anyway ur method can find the factorials of large numbers.
    Follow Math Help Forum on Facebook and Google+

  14. #14
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by chogo View Post
    hang on maybe some confusion. spanner were finding a method of carrying out the factorial function not the LCM. I dont see how in anyway ur method can find the factorials of large numbers.
    I think that is what I was trying to indicate, indirectly so as not to cause offence .

    RonL
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Sum of Factorial
    Posted in the Calculus Forum
    Replies: 2
    Last Post: January 4th 2011, 12:10 PM
  2. Factorial N
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: August 28th 2010, 10:18 PM
  3. Discrete Factorial + Composite numbers.
    Posted in the Discrete Math Forum
    Replies: 4
    Last Post: January 25th 2010, 07:29 AM
  4. factorial!
    Posted in the Statistics Forum
    Replies: 5
    Last Post: January 18th 2010, 03:58 PM
  5. factorial
    Posted in the Algebra Forum
    Replies: 3
    Last Post: January 15th 2009, 07:13 AM

/mathhelpforum @mathhelpforum