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.
%I A051664 #32 Feb 16 2025 08:32:41 %S A051664 2,2,3,2,5,3,7,2,3,5,11,3,13,7,7,2,17,3,19,5,9,11,23,3,5,13,3,7,29,7, %T A051664 31,2,15,17,17,3,37,19,17,5,41,9,43,11,7,23,47,3,7,5,23,13,53,3,17,7, %U A051664 25,29,59,7,61,31,9,2,31,15,67,17,31,17,71,3,73,37,7,19,31,17,79,5,3 %N A051664 a(n) is the number of nonzero coefficients in the n-th cyclotomic polynomial. %C A051664 a(n)=p(n) if n=p(n); a(n) is not always A006530(n). - _Labos Elemer_, May 03 2002 %C A051664 This sequence is the Mobius transform of A087073. Let m be the squarefree part of n, then a(n) = a(m). When n = pq, the product of two distinct odd primes, then there is a formula for a(pq). Let x = 1/p (mod q) and y = 1/q (mod p). Then a(pq) = 2xy-1. There are also formulas for the number of positive and negative terms. See papers by Carlitz or Lam and Leung. - _T. D. Noe_, Aug 08 2003 %H A051664 T. D. Noe, <a href="/A051664/b051664.txt">Table of n, a(n) for n = 1..1000</a> %H A051664 L. Carlitz, <a href="http://www.jstor.org/stable/2314500">Number of terms in the cyclotomic polynomial F(pq,x)</a>, Amer. Math. Monthly, Vol. 73, No. 9, 1966, pp. 979-981. %H A051664 T. Y. Lam and K. H. Leung, <a href="http://www.jstor.org/stable/2974668">On the Cyclotomic Polynomial Phi(pq,x)</a>, Amer. Math. Monthly, Vol. 103, No. 7, 1996, pp. 562-564. %H A051664 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CyclotomicPolynomial.html">Cyclotomic Polynomial</a> %F A051664 a(n) = phi(n) + 1 - A086798(n). - _T. D. Noe_, Aug 08 2003 %e A051664 9th cyclotomic polynomial is x^6+x^3+1 which has 3 terms, so a(9)=3. %p A051664 A051664 := proc(n) %p A051664 numtheory[cyclotomic](n,x) ; %p A051664 nops([coeffs(%)]) ; %p A051664 end proc: # _R. J. Mathar_, Sep 15 2012 %t A051664 Table[Count[CoefficientList[Cyclotomic[n, x], x], _?(#!=0&)], {n, 0, 100}] %t A051664 Table[Length[Cyclotomic[n, x]], {n, 1, 100}] (* _Artur Jasinski_, Jan 15 2007 *) %o A051664 (PARI) a(n)=sum(k=0,eulerphi(n),if(polcoeff(polcyclo(n),k),1,0)) %o A051664 (PARI) a(n) = #select(x->x!=0, Vec(polcyclo(n))); \\ _Michel Marcus_, Mar 05 2017 %Y A051664 Cf. A086765 (number of positive terms in n-th cyclotomic polynomial), A086780 (number of negative terms in n-th cyclotomic polynomial), A086798 (number of zero terms in n-th cyclotomic polynomial), A087073. %K A051664 nonn %O A051664 1,1 %A A051664 _Jud McCranie_ %E A051664 More terms from _Labos Elemer_, May 03 2002