Tags:
1. Oct 16, 2016

### SYoungblood

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. Oct 16, 2016

### lewando

What do you mean by "a larger sum than this" ?

3. Oct 16, 2016

### phyzguy

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?

4. Oct 17, 2016

### SYoungblood

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

5. Oct 17, 2016

### phyzguy

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.

6. Oct 17, 2016

### SYoungblood

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