Ну а если без матлаба - то... Mathematica: Algebra`FiniteFields`:IrreduciblePolynomial[s, p, d] find an irreducible polynomial of degree "d" over the integers mod prime "p", expressed in terms of the symbol "s"
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)