lin7xu's blog

By lin7xu, history, 8 days ago, In English

How to calculate the coefficient of $$$\prod\limits_{i=0}^{p-1}(x+i) \bmod p$$$ ($$$p$$$ is a prime)? Thank you for reply.

 
 
 
 
  • Vote: I like it
  • +8
  • Vote: I do not like it

»
8 days ago, # |
  Vote: I like it +10 Vote: I do not like it

It is also the first kind of Stirling number.

»
8 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
x * (x+1) * (x+2) * (x+3) * (x+4) * ... * (x + (p-1))

any number when divided by p, leaves remainder 0, or 1, ..., or p-1

hence, Out of the above, exactly one term will be divisible by p

hence, the remainder will be 0 (ZERO) or

  x * (x+1) * (x+2) * (x+3) * (x+4) * ... * (x + (p-1)) mod p = 0

----------------------THE END BUT-------------------------------

if you want coefficient of

x * (x+1) * (x+2) * (x+3) * (x+4) * ... * (x + (p-1)) divided by p,

then please follow below:
thanks :)

if x%p == 0  
  then k = 0;  
else  
  then k = p * ((x/p) + 1) - x;  

iteration=0  
while(iteration <= p-1)  
  if(iteration != k)  
    product = product  * (x + iteration)  

** product is your answer **
hope this helps...

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

which coefficient r u interested in?

»
8 days ago, # |
  Vote: I like it +4 Vote: I do not like it

In fact the answer is very beautiful, but sadly no one mentioned it.. It equals to $$$x^p-x$$$. I don't know why, can anyone explain it?

  • »
    »
    8 days ago, # ^ |
      Vote: I like it +21 Vote: I do not like it

    From Fermat's theory we know that $$$x^p \equiv x\pmod p$$$ holds for every integer. So when modulo $$$p$$$, $$$F(x)=x^p-x$$$ must be a multiple of $$$x,x+1,…,x+(p-1)$$$ at the same time. Pay attention to the fact that $$$F$$$ is of degree $$$p$$$, and the given equation is proved.

»
8 days ago, # |
  Vote: I like it +2 Vote: I do not like it

Now, I'm not a math genius or anything.

However, I do know that when multiplying a list of X consecutive numbers, the result is always divisible by X. Therefore, the answer to your question is 0, because the result is always divisible by P, even if P is a prime.

  • »
    »
    8 days ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    I want to calculate the coefficient for every $$$x^i$$$, and the answer is $$$x^p-x$$$, that there is only two nonempty positions.