%I #119 Nov 24 2023 12:38:24
%S 1,1,1,2,2,2,3,4,3,4,5,4,6,6,4,8,8,6,9,8,6,10,11,8,10,12,9,12,14,8,15,
%T 16,10,16,12,12,18,18,12,16,20,12,21,20,12,22,23,16,21,20,16,24,26,18,
%U 20,24,18,28,29,16,30,30,18,32,24,20,33,32,22,24,35,24,36,36,20,36,30
%N a(1) = 1, a(n) = phi(2*n)/2 for n > 1.
%C For n > 1, gives number of times n appears in A094192. - _Lekraj Beedassy_, Jun 04 2004
%C Number of positive integers less than n that are relatively prime to n, and have opposite parity to n, for n >= 2. a(1) = 1. - Anne M. Donovan (anned3005(AT)aol.com), Jul 18 2005 [rewritten by _Wolfdieter Lang_, Apr 08 2020]
%C Degree of minimal polynomial of cos(Pi/n) over the rationals. For the minimal polynomials of 2*cos(Pi/n), n >= 1, see A187360. - _Wolfdieter Lang_, Jul 19 2011
%C a(n) is, for n >= 2, the number of (positive) odd numbers 2*k+1 < n satisfying gcd(2*k+1,n)=1. See the formula for the zeros of the minimal polynomials A187360. E.g., n=10: 1,3,7,9, hence a(10)=4. - _Wolfdieter Lang_, Aug 17 2011
%C a(n) is, for n >= 2, the number of nonzero entries in row n of the triangle A222946. See the Beedassy and Donovan comment. - _Wolfdieter Lang_, Mar 24 2013
%C Number of partitions of 2n into exactly two relatively prime parts. - _Wesley Ivan Hurt_, Dec 22 2013
%C For n > 1, a(n) is the number of pairs of complex embeddings of the (2n)-th cyclotomic field Q(zeta_(2n)) (there are no real embeddings). Note that Q(zeta_n) = Q(zeta_(2n)) for odd n. By Dirichlet's unit theorem, the group of units of Z[zeta_(2n)] is isomorphic to C_(2n) X Z^{a(n)-1}, where C_(2n) is the group of all (2n)-th roots of unity. - _Jianing Song_, May 17 2021
%C For n > 1, a(n) is the number of primitive Pythagorean triples (f,g,h) for which there exist positive integers n and k such that f = 2*n*k, g = n^2 - k^2, h = n^2 + k^2. Let U = {1,2,...,2*n-1}, V = {v element of U: v mod 2 = 0}, W = {w element of U\V: gcd(w,2*n) != 1} and X = {1,2,...,n-1}, Y = {y element of X: n == y (mod 2)}, Z = {z element of X\Y: gcd(z,n) != 1}. Then phi(2*n) = |U| - (|V| + |W|) = 2*n - 1 - (2*|Y| + 2*|Z| + 1) = 2*n - 2 - 2*|Y| - 2*|Z| and phi(2*n)/2 = n - 1 - |Y| - |Z|. This is equivalent to the number of primitive Pythagorean triples (f,g,h), where from n-1 pairs (n,k) the ones with n == k (mod 2) or gcd(n,k) != 1 have to be subtracted. - _Felix Huber_, Apr 17 2023
%H T. D. Noe, <a href="/A055034/b055034.txt">Table of n, a(n) for n = 1..2000</a>
%H Sameen Ahmed Khan, <a href="https://doi.org/10.13189/ms.2021.090605">Trigonometric Ratios Using Algebraic Methods</a>, Mathematics and Statistics, Vol. 9, No. 6 (2021), 899-907.
%H Wolfdieter Lang, <a href="https://arxiv.org/abs/2008.04300">On the Equivalence of Three Complete Cyclic Systems of Integers</a>, arXiv:2008.04300 [math.NT], 2020.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/TrigonometryAngles.html">Trigonometry Angles</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Pythagorean_triple#Generating_a_triple">Pythagorean triple, Euclid's formula.
%F a(n) = ceiling( phi(2n)/2 ). - _Wesley Ivan Hurt_, Jun 16 2013
%F a(n) = Sum_{i=1..n} floor(1 / gcd(2n-i, i)). - _Wesley Ivan Hurt_, Dec 22 2013
%F G.f.: (x + Sum_{n>=1} mu(2n-1) * x^(2n-1) / (1-x^(2n-1))^2) / 2 . - _Mamuka Jibladze_, Dec 14 2022
%F Sum_{k=1..n} a(k) ~ c * n^2, where c = 2/Pi^2 = 0.202642... (A185197). - _Amiram Eldar_, Feb 11 2023
%e a(10) = 4 since the primitive Pythagorean triples generated by Euclid's formula (n, k) -> [2*n*k, n^2 - k^2, n^2 + k^2] are: (10, 1) -> [20, 99, 101]; (10, 3) -> [60, 91, 109]; (10, 7) -> [140, 51, 149]; (10, 9) -> [180, 19, 181]. - _Peter Luschny_, Apr 16 2023
%p with(numtheory); A055034:=n->ceil(phi(2*n)/2);
%p seq(A055034(k), k=1..100); # _Wesley Ivan Hurt_, Oct 24 2013
%p a := n -> if n = 1 then 1 else iquo(NumberTheory:-Totient(2*n), 2) fi:
%p seq(a(k), k = 1..100); # _Peter Luschny_, Apr 16 2023
%t Join[{1}, EulerPhi[2*Range[2,100]]/2] (* _Harvey P. Dale_, Aug 12 2011 *)
%o (PARI) a(n)=ceil(eulerphi(2*n)/2) \\ _Charles R Greathouse IV_, Feb 21 2013
%o (Python)
%o from sympy import totient
%o def A055034(n): return totient(n<<1)>>1 if n>1 else 1 # _Chai Wah Wu_, Nov 24 2023
%Y Cf. A000010, A094192, A185197, A187360, A222946.
%K nonn,easy
%O 1,4
%A Shawn Cokus (Cokus(AT)math.washington.edu)
%E Better description from _Benoit Cloitre_, Feb 01 2002
%E Edited by _Ray Chandler_, Jul 20 2005