cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A087610 Number of (-1,0,1) polynomials of degree-n irreducible over the integers.

This page as a plain text file.
%I A087610 #13 Feb 16 2025 08:32:51
%S A087610 3,5,12,34,104,292,916,2791,8660,26538,81584,248554
%N A087610 Number of (-1,0,1) polynomials of degree-n irreducible over the integers.
%C A087610 A (-1,0,1) polynomial is defined as a monic polynomial whose remaining coefficients are either -1, 0, or 1. For each n, there are 3^n polynomials to consider.
%H A087610 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/IrreduciblePolynomial.html">Irreducible Polynomial</a>
%e A087610 a(2) = 5 because 1+x+x^2, 1+x^2, 1-x+x^2, -1+x+x^2, -1-x+x^2 are irreducible over the integers.
%p A087610 F:= proc(n) local T, count, t,x,p;
%p A087610       if n::odd then
%p A087610         T:= combinat:-cartprod([[-1,0,1]$(n-1),[1]])
%p A087610       else
%p A087610         T:= combinat:-cartprod([[-1,0,1]$(n-1),[-1,1]])
%p A087610       fi;
%p A087610       count:= 0;
%p A087610       while not T[finished] do
%p A087610          t:= T[nextvalue]();
%p A087610          p:= x^n + add(t[i]*x^(n-i),i=1..n);
%p A087610          if irreduc(p) then count:= count+1 fi;
%p A087610       od;
%p A087610       if n::odd then 2*count else count fi;
%p A087610 end proc:
%p A087610 3, seq(F(n),n=2..11); # _Robert Israel_, Dec 10 2015
%t A087610 Irreducible[p_, n_] := Module[{f}, f=FactorList[p, Modulus->n]; Length[f]==1 || Simplify[p-f[[2, 1]]]===0]; Table[xx=x^Range[0, n-1]; cnt=0; Do[p=x^n+xx.(IntegerDigits[i, 3, n]-1); If[Irreducible[p, 0], cnt++ ], {i, 0, 3^n-1}]; cnt, {n, 10}]
%Y A087610 Cf. A087481 (irreducible polynomials of the form x^n +- x^(n-1) +- x^(n-2) +- ... +- 1), A087482 (irreducible binary polynomials).
%K A087610 nonn,more
%O A087610 1,1
%A A087610 _T. D. Noe_, Sep 11 2003
%E A087610 a(11) and a(12) from _Robert Israel_, Dec 10 2015