|
|
A230799
|
|
The number of distinct nonzero coefficients in the n-th cyclotomic polynomial.
|
|
2
|
|
|
2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The sum of the coefficients in the n-th cyclotomic polynomial is given by A020500.
The first occurrence of 4 in this sequence is a(330).
|
|
LINKS
|
|
|
EXAMPLE
|
a(12)=2 because the distinct nonzero coefficients of the 12th cyclotomic polynomial, x^4 - x^2 + 1, are 1 and -1.
|
|
MAPLE
|
A230799 := n -> nops({coeffs(numtheory[cyclotomic](n, z), z)}):
|
|
MATHEMATICA
|
a[n_] := List @@ Cyclotomic[n, x] /. x -> 1 // Union // Length;
|
|
PROG
|
(PARI) a(n) = v=vecsort(Vec(polcyclo(n)), , 8); if(has_zero(v), #v-1, #v)
has_zero(v) = for(i=1, #v, if(v[i]==0, return(1))); 0
(PARI) {a(n) = if( n<1, 0, #setminus( Set( Vec( polcyclo(n))), [0]))};
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|