login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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)}):
seq(A230799(n), n=1..86); # Peter Luschny, Oct 30 2013
MATHEMATICA
a[n_] := List @@ Cyclotomic[n, x] /. x -> 1 // Union // Length;
Array[a, 100] (* Jean-François Alcover, Jul 08 2019 *)
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]))};
/* Michael Somos, Mar 27 2014 */
CROSSREFS
Sequence in context: A321650 A205007 A078470 * A279496 A151683 A133912
KEYWORD
nonn
AUTHOR
Colin Barker, Oct 30 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 15:20 EDT 2024. Contains 371916 sequences. (Running on oeis4.)