cp's OEIS Frontend

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.

A086227 a(n) = Sum_{1<=k<=4*n, gcd(k,n)=1} (i^k*tan(k*Pi/(4*n)))/(4*i), where i is the imaginary unit.

This page as a plain text file.
%I A086227 #33 Jun 24 2024 08:48:22
%S A086227 -1,2,-2,2,-4,4,-4,6,-4,6,-8,6,-8,8,-8,8,-12,10,-8,16,-12,12,-16,10,
%T A086227 -12,18,-16,14,-16,16,-16,24,-16,16,-24,18,-20,24,-16,20,-32,22,-24,
%U A086227 24,-24,24,-32,28,-20,32,-24,26,-36,24,-32,40,-28,30,-32,30,-32,48,-32,24,-48,34,-32,48,-32,36,-48,36,-36,40,-40,48,-48
%N A086227 a(n) = Sum_{1<=k<=4*n, gcd(k,n)=1} (i^k*tan(k*Pi/(4*n)))/(4*i), where i is the imaginary unit.
%C A086227 This seems to be (-1)^(n+1) times h(-4n^2) = (-1)^(n+1)*A000003(n^2), where h(k) is the class number. Verified for n <= 10^5. - _Charles R Greathouse IV_, Apr 28 2013
%H A086227 Amiram Eldar, <a href="/A086227/b086227.txt">Table of n, a(n) for n = 2..10000</a>
%H A086227 Stanley Rabinowitz, <a href="https://cms.math.ca/publications/crux/issue?volume=22&amp;issue=3">Problem 2129</a>, Crux Mathematicorum, Vol. 22, No. 3 (1996), p. 123; <a href="https://cms.math.ca/publications/crux/issue?volume=23&amp;issue=4">Solution to Problem 2129</a>, by G. P. Henderson and Kurt Girstmair, ibid., Vol. 23, No. 4 (1997), pp. 246-249.
%F A086227 a(n) = -A204617(n) if n is even, and A204617(n)/2 if n is odd (Rabinowitz, 1996). - _Amiram Eldar_, Mar 07 2022
%F A086227 a(n) = (-1)^(n+1)*A079458(n)/A140434(n). - _Ridouane Oudra_, Jun 23 2024
%t A086227 f[p_, e_] := p^(e - 1) * Switch[Mod[p, 4], 2, 1, 1, p - 1, 3, p + 1]; s[n_] := Times @@ f @@@ FactorInteger[n]; a[n_] := If[EvenQ[n], -s[n], s[n]/2]; Array[a, 100, 2] (* _Amiram Eldar_, Mar 07 2022 *)
%o A086227 (PARI) a(n)=round(real(1/4/I*sum(k=1,4*n,(I^k)*tan(Pi/4/n*if(gcd(k,n)-1,0,k)))))
%o A086227 (PARI) a(n)=round(imag(sum(k=1,4*n,if(gcd(k,n)==1,I^k*tan(k*Pi/4/n))))/4) \\ _Charles R Greathouse IV_, Apr 25 2013
%o A086227 (PARI) a(n)=my(s);for(k=1,2*n,if(gcd(2*k-1,n)==1,s-=(-1)^k*tan((2*k-1)*Pi/4/n))); round(s/4) \\ _Charles R Greathouse IV_, Apr 25 2013
%Y A086227 Cf. A000003, A204617,A079458, A140434.
%K A086227 sign
%O A086227 2,2
%A A086227 _Benoit Cloitre_, Aug 28 2003
%E A086227 Definition corrected by _Charles R Greathouse IV_, Apr 25 2013