facteurs = First[Transpose[
Drop[FactorList[X^24-1],2]]]
(* List of irreducible factors, minus (X-1).
The Φn are created from the procedure FactorList
*)
nbreFacteurs = Length[facteurs]
One wishes to partition this list in two subsets, the factors of and
. A cool way of doing this is to iterate from 0000…01 to 111…111 in binary digits, the number of digits being the length of the list: from 1 to
(half is actually enough, by symmetry).
IntegerDigits[37, 2, nbreFacteurs]
The 1's will pinpoint the position of the factors of in the list, the 0's pinpoint
's.
First /@ Position[IntegerDigits[37, 2, nbreFacteurs], 1]
Map[facteurs[[#]]&, %]
Now we have the first term :
Apply[Times,%]//Expand
(X^24-1)/% // Cancel
Here , hence the result is rejected.