close
login
A389480
Triangle read by rows where T(n,k) is the algebraic degree of cos(k*Pi/n).
8
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, 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 4, 2, 2, 1, 4, 1, 4, 1, 2, 2, 4, 1
OFFSET
0,12
FORMULA
T(n,k) = T(n-k,k).
T(n,0) = T(n,n) = 1.
T(n,n/2) = 1, n is even.
T(n,k) = T(n/gcd(n,k),k/gcd(n,k)) and thus T(n*k,k) = T(n,1).
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).
T(n,1) = phi(2*n)/2 = A055034(n), phi(k) = A000010(k).
T(n,2) = phi(n)/2 = A023022(n), phi(k) = A000010(k).
EXAMPLE
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.
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.
Triangle begins:
n\k 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0: 1
1: 1 1
2: 1 1 1
3: 1 1 1 1
4: 1 2 1 2 1
5: 1 2 2 2 2 1
6: 1 2 1 1 1 2 1
7: 1 3 3 3 3 3 3 1
8: 1 4 2 4 1 4 2 4 1
9: 1 3 3 1 3 3 1 3 3 1
10: 1 4 2 4 2 1 2 4 2 4 1
11: 1 5 5 5 5 5 5 5 5 5 5 1
12: 1 4 2 2 1 4 1 4 1 2 2 4 1
13: 1 6 6 6 6 6 6 6 6 6 6 6 6 1
14: 1 6 3 6 3 6 3 1 3 6 3 6 3 6 1
15: 1 4 4 2 4 1 2 4 4 2 1 4 2 4 4 1
16: 1 8 4 8 2 8 4 8 1 8 4 8 2 8 4 8 1
17: 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 1
18: 1 6 3 2 3 6 1 6 3 1 3 6 1 6 3 2 3 6 1
19: 1 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 1
20: 1 8 4 8 2 2 4 8 2 8 1 8 2 8 4 2 2 8 4 8 1
MATHEMATICA
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 *)
PROG
(Python)
from math import gcd
from sympy import totient
def A389480(n, k):
if k == 0 or k == n or 2*k == n:
return 1
else:
return totient(n//gcd(n, k))//(1+(n//gcd(n, k))%2)
n, m = 0, 0
while n < 87:
k = 0
while k <= m:
print(A389480(m, k), end = ", ")
n, k = n+1, k+1
m += 1
(PARI) T(n, k) = if ((k==0) || (k==n) || (2*k==n), 1, eulerphi(n/gcd(n, k))/(1+(n/gcd(n, k))%2));
row(n) = vector(n+1, k, T(n, k-1)); \\ Michel Marcus, Nov 27 2025
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
A.H.M. Smeets, Nov 18 2025
STATUS
approved