%I #113 Nov 27 2025 22:03:13
%S 1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,1,2,2,2,2,1,1,2,1,1,1,2,1,1,3,3,3,3,3,
%T 3,1,1,4,2,4,1,4,2,4,1,1,3,3,1,3,3,1,3,3,1,1,4,2,4,2,1,2,4,2,4,1,1,5,
%U 5,5,5,5,5,5,5,5,5,1,1,4,2,2,1,4,1,4,1,2,2,4,1
%N Triangle read by rows where T(n,k) is the algebraic degree of cos(k*Pi/n).
%H R. J. Mathar, <a href="https://vixra.org/abs/2210.0026">Reduction formulas of the cosine of integer fractions of Pi</a>, (2008) vixra:2210.0026.
%F T(n,k) = T(n-k,k).
%F T(n,0) = T(n,n) = 1.
%F T(n,n/2) = 1, n is even.
%F T(n,k) = T(n/gcd(n,k),k/gcd(n,k)) and thus T(n*k,k) = T(n,1).
%F T(n,k) = phi(k)/m iff gcd(n,k) = 1, where m = 1 for k is even and m = 2 for k is odd, phi(k) = A000010(k).
%F T(n,1) = phi(2*n)/2 = A055034(n), phi(k) = A000010(k).
%F T(n,2) = phi(n)/2 = A023022(n), phi(k) = A000010(k).
%e T(13,1) = 6 because cos(Pi/13) is the largest of the 6 real-valued roots of 64*x^6 - 32*x^5 - 80*x^4 + 32*x^3 + 24*x^2 - 6*x - 1 = 0 (see also A387441). Moreover, the 6 roots are cos(n*Pi/13) where n satisfies 0 < n < 13 and n == 1 (mod 2), which holds for 6 different values of n. The other set of 6 roots is obtained from the minimal polynomial 64*x^6 + 32*x^5 - 80*x^4 - 32*x^3 + 24*x^2 + 6*x - 1 = 0 (opposite sign for odd powers) with roots cos(n+Pi/13) where n satisfies 0 < n < 13 and n == 0 (mod 2), i.e., T(15,2) = T(15,1) = 6.
%e T(15,1) = 4 because cos(Pi/15) is the largest of the 4 real-valued roots of 16*x^4 + 8*x^3 - 16*x^2 - 8*x + 1 = 0 (see also A019887). Moreover, the 4 roots are cos(n*Pi/15) where n satisfies 0 < n < 15 and n == 1 (mod 2) and gcd(n,15) = 1, which holds for 4 different values of n. Another set of 4 roots is obtained from the minimal polynomial 16*x^4 - 8*x^3 - 16*x^2 + 8*x + 1 = 0 (opposite sign for odd powers) with roots cos(n+Pi/15) where n satisfies 0 < n < 15 and n == 0 (mod 2) and gcd(n,15) = 1, i.e., T(13,2) = T(13,1) = 4.
%e Triangle begins:
%e n\k 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
%e 0: 1
%e 1: 1 1
%e 2: 1 1 1
%e 3: 1 1 1 1
%e 4: 1 2 1 2 1
%e 5: 1 2 2 2 2 1
%e 6: 1 2 1 1 1 2 1
%e 7: 1 3 3 3 3 3 3 1
%e 8: 1 4 2 4 1 4 2 4 1
%e 9: 1 3 3 1 3 3 1 3 3 1
%e 10: 1 4 2 4 2 1 2 4 2 4 1
%e 11: 1 5 5 5 5 5 5 5 5 5 5 1
%e 12: 1 4 2 2 1 4 1 4 1 2 2 4 1
%e 13: 1 6 6 6 6 6 6 6 6 6 6 6 6 1
%e 14: 1 6 3 6 3 6 3 1 3 6 3 6 3 6 1
%e 15: 1 4 4 2 4 1 2 4 4 2 1 4 2 4 4 1
%e 16: 1 8 4 8 2 8 4 8 1 8 4 8 2 8 4 8 1
%e 17: 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 1
%e 18: 1 6 3 2 3 6 1 6 3 1 3 6 1 6 3 2 3 6 1
%e 19: 1 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 1
%e 20: 1 8 4 8 2 2 4 8 2 8 1 8 2 8 4 2 2 8 4 8 1
%t T[n_,k_]:=If[k==0||k==n||2k==n,1,EulerPhi[n / GCD[n, k]] / (1 + Mod[n / GCD[n, k], 2])];Table[T[n,k],{n,0,12},{k,0,n}]//Flatten (* _James C. McMahon_, Nov 27 2025 *)
%o (Python)
%o from math import gcd
%o from sympy import totient
%o def A389480(n,k):
%o if k == 0 or k == n or 2*k == n:
%o return 1
%o else:
%o return totient(n//gcd(n,k))//(1+(n//gcd(n,k))%2)
%o n, m = 0, 0
%o while n < 87:
%o k = 0
%o while k <= m:
%o print(A389480(m,k), end = ", ")
%o n, k = n+1, k+1
%o m += 1
%o (PARI) T(n,k) = if ((k==0) || (k==n) || (2*k==n), 1, eulerphi(n/gcd(n, k))/(1+(n/gcd(n, k))%2));
%o row(n) = vector(n+1, k, T(n, k-1)); \\ _Michel Marcus_, Nov 27 2025
%Y Cf. A000010, A019887, A023022, A055034, A387441.
%K nonn,tabl
%O 0,12
%A _A.H.M. Smeets_, Nov 18 2025