OFFSET
1,1
COMMENTS
Multiply by 2 to get all that have coefficients in {0,1,-1}.
Note that many of these are equal to 2^tau(n), where tau(n) is the number of positive divisors of n = number of irreducible factors of x^n - 1. This is connected with the fact that for small values of n the coefficients of the n-th cyclotomic polynomial belong to {0,1,-1}.
From Robert Israel, Aug 24 2017: (Start)
Each of these polynomials is a product of distinct cyclotomic polynomials C_k(x) for k dividing n.
a(n) <= 2^tau(n).
If n is prime then a(n)=4. (End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..719 (n=1..359 from Antti Karttunen)
MAPLE
f:= proc(n) local t, C, x, S;
C:= map(m -> numtheory:-cyclotomic(m, x), numtheory:-divisors(n) );
t:= 0:
S:= combinat:-subsets(C);
while not S[finished] do
if map(abs, {coeffs(expand(convert(S[nextvalue](), `*`)), x)}) = {1} then
t:= t+1;
fi
od;
t
end proc:
map(f, [$1..100]); # Robert Israel, Aug 24 2017
PROG
(PARI) for(n=1, 359, m=0; p=x^n-1; nE=numdiv(n); P=factor(p); E=P[, 2]; P=P[, 1]; forvec(v=vector(nE, i, [0, E[i]]), divp=prod(k=1, nE, P[k]^v[k]); m++; for(j=0, poldegree(divp), divpcof=polcoeff(divp, j); if(divpcof<-1 || divpcof>1, m--; break))); write("b107748.txt", n, " ", m)); \\ Antti Karttunen, Aug 24 2017, after Herman Jamke's PARI-program for A107067
CROSSREFS
KEYWORD
nonn
AUTHOR
W. Edwin Clark, Jun 11 2005
STATUS
approved