当n为奇数时,x^n+1=(x+1)(x^(n-1)-x^(n-2)+…-x+1)这是公式.
当n为偶数时,x^n-1除x+1得x^n-1=(x+1)(x^(n-1)-x^(n-2)+…+x-1)
即x^n=(x+1)(x^(n-1)-x^(n-2)+…+x-1)+1
当n为奇数时,x^n+1=(x+1)(x^(n-1)-x^(n-2)+…-x+1)这是公式.
当n为偶数时,x^n-1除x+1得x^n-1=(x+1)(x^(n-1)-x^(n-2)+…+x-1)
即x^n=(x+1)(x^(n-1)-x^(n-2)+…+x-1)+1