1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Hexadecimal and factorial problem

  1. Oct 16, 2016 #1
    1. The problem statement, all variables and given/known data

    Hello all,

    I am trying to determine the last hexadecimal digit of a sum of rather large factorials. To start, I have the sum 990! + 991! +...+1000!. I am trying to find the last hex digit of a larger sum than this, but I think all I need is a push in the right direction, because right now I am lost.


    2. Relevant equations
    To start, I have the sum 990! + 991! +...+1000!. I am trying to find the last hex digit of a larger sum than this, but I think all I need is a push in the right direction, because right now I am lost. Any info on how to determine the last hex digit of a large factorial, even just 1000!, is greatly appreciated.

    3. The attempt at a solution

    Where would I even begin? I tried to convert 1000 to hexadecimal form -- 3E8 -- but that didn't seem to help me at all, or at least not as much as I thought it would.

    Any and all help is greatly appreciated.

    SY
     
  2. jcsd
  3. Oct 16, 2016 #2

    lewando

    User Avatar
    Gold Member

    What do you mean by "a larger sum than this" ?
     
  4. Oct 16, 2016 #3

    phyzguy

    User Avatar
    Science Advisor

    Suppose the problem were in decimal rather than hexadecimal? What are the last digits of a large factorial number in decimal notation? Why? What about in hexadecimal?
     
  5. Oct 17, 2016 #4
    GAAH.

    I see what you got -- we will have a large number of zeroes (I'm too lazy to figure out how many) -- certainly more than four, which establishes divisibility by 16, and then we convert to hex.

    Thank you,

    SY
     
  6. Oct 17, 2016 #5

    phyzguy

    User Avatar
    Science Advisor

    I'd state it differently. In decimal, every time we accumulate another factor of 10, we add another zero to the end. So when we multiply by 10, 20, 30, ... each one adds a zero. Also each combination of 2 and 5 adds another zero. In hex, every time we multiply by a multiple of 16 (16, 32, 48, ...), we add a zero to the end. Also accumulating 4 powers of 2 adds another zero on the end. So 1000! will have over 200 zeros on the end, either in decimal or in hex.
     
  7. Oct 17, 2016 #6
    I was able to figure it out.

    Th actual question is to find the final hex digit of 1! + 2! + 3! + ... + 1000! Since, as you said, we accumulate zeroes in summing factorials at every fifth element (4!=24; 5!=120, 9!=362,880 10!=3,628,800...) we only need to find the values up to 20! (For the larger values, I cheated and used Wolfram.) We only need the sum of the last four digits, because to test divisibility by 16, we only need to check the last four digits, then like the zeroes, the changing place values shift further to the left. The final four (well, 5) digits of the sum from 1! through 20! is 60,313, and that is EB99 in hex notation.

    Thanks much,

    SY
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Hexadecimal and factorial problem
Loading...