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 A020513 #33 Aug 26 2024 13:33:59 %S A020513 -1,-2,0,1,2,1,3,1,2,1,5,1,1,1,7,1,2,1,3,1,1,1,11,1,1,1,13,1,1,1,1,1, %T A020513 2,1,17,1,1,1,19,1,1,1,1,1,1,1,23,1,1,1,5,1,1,1,3,1,1,1,29,1,1,1,31,1, %U A020513 2 %N A020513 Cyclotomic polynomials evaluated at x=-1. %H A020513 Robert Israel, <a href="/A020513/b020513.txt">Table of n, a(n) for n = 0..10000</a> %H A020513 E. T. Bell, <a href="http://dx.doi.org/10.1090/S0002-9904-1927-04394-4">Cauchy’s cyclotomic function and functional powers</a>, Bull. Amer. Math. Soc. 33 (1927), 416-422. %H A020513 Bartlomiej Bzdega, Andres Herrera-Poyatos, and Pieter Moree, <a href="https://arxiv.org/abs/1611.06783">Cyclotomic polynomials at roots of unity</a>, arXiv:1611.06783 [math.NT], 2016-2017. See Lemma 7. %F A020513 For n >= 3: if n = 2*p^m with a prime p then a(n) = p otherwise a(n) = 1. - Ola Veshta (olaveshta(AT)my-deja.com), Jun 01 2001 %p A020513 with(numtheory,cyclotomic); f := n->subs(x=-1,cyclotomic(n,x)); seq(f(i),i=0..64); %t A020513 Array[Cyclotomic[#, -1] &, 90, 0] (* _Robert G. Wilson v_, Nov 23 2016 *) %o A020513 (PARI) a(n) = if (n==0, -1, subst(polcyclo(n), x, -1)); \\ _Michel Marcus_, Apr 22 2016 %o A020513 (PARI) a(n) = if (n==0, -1, if (n==1, -2, if (n==2, 0, if (!(n % 2) && isprimepower(n/2,&p), p, 1)))); \\ _Michel Marcus_, Nov 23 2016 %o A020513 (Python) %o A020513 from sympy import primefactors %o A020513 def A020513(n): return (-1,-2,0)[n] if n<3 else (f[0] if n&1^1 and len(f:=primefactors(n>>1))==1 else 1) # _Chai Wah Wu_, Aug 26 2024 %Y A020513 Cf. A138929 (2*p^m, m >= 0 values). %K A020513 sign %O A020513 0,2 %A A020513 _Simon Plouffe_