x7 + x2 + 1 = (x7 – x) + (x2 + x + 1)
= x.(x6 – 1) + (x2 + x +1)
= x.(x3 - 1).(x3 +1) + (x2 + x +1)
= x.(x-1).(x2 + x +1).(x3 +1) + (x2 + x +1)
= (x2 + x +1).[x.(x-1).(x3 +1) + 1]
= (x2 + x +1).[(x2-x).(x3 +1) + 1]
= (x2 + x +1).(x5-x4 + x2 -x + 1)