login
A384717
Sum of floored squared chord lengths from -1 to the 2n-th roots of unity (upper semicircle, endpoints excluded).
1
0, 2, 4, 5, 6, 9, 9, 11, 13, 14, 15, 18, 18, 20, 22, 23, 24, 27, 27, 29, 31, 32, 33, 36, 36, 38, 40, 41, 42, 45, 45, 47, 49, 50, 51, 54, 54, 56, 58, 59, 60, 63, 63, 65, 67, 68, 69, 72, 72, 74, 76, 77, 78, 81, 81, 83, 85, 86, 87, 90, 90, 92, 94, 95, 96, 99, 99
OFFSET
1,2
COMMENTS
Let z_k = exp(i*Pi*k/n) for k = 1..n-1 (upper 2n-th roots, excluding endpoints +-1). By Euler's formula, |1 + z_k|^2 = 2 + 2*cos(Pi*k/n). The sequence a(n) is Sum_{k=1..n-1} floor(2 + 2*cos(Pi*k/n)), i.e., the sum of floored squared chord lengths from -1 to those points.
Distribution of the summands: floor(2 + 2*cos(Pi*k/n)) takes values 3, 2, 1, 0 exactly floor(n/3), floor(n/2) - floor(n/3), floor(2*n/3) - floor(n/2), (n-1) - floor(2*n/3) times, respectively.
If one includes the endpoints (k = 0 and k = n), the resulting total is a(n) + 4.
FORMULA
a(n) = floor(n/2) + floor(n/3) + floor(2*n/3).
From Elmo R. Oliveira, Apr 12 2026: (Start)
a(n) = a(n-2) + a(n-3) - a(n-5).
G.f.: x^2*(2 + 4*x + 3*x^2)/((1 - x^2)*(1 - x^3)). (End)
EXAMPLE
n = 10: the list floor(2 + 2*cos(Pi*k/10)) for k = 1..9 is 3, 3, 2, 2, 2, 1, 1, 0, 0; sum = 14.
Check with the closed form: floor(10/2) + floor(10/3) + floor(20/3) = 5 + 3 + 6 = 14.
MATHEMATICA
A384717[n_] := Quotient[n, 2] + Quotient[n, 3] + Quotient[2*n, 3];
Array[A384717, 100] (* Paolo Xausa, Aug 28 2025 *)
PROG
(MATLAB)
function an = euler_chord_term(n)
an = floor(n/2) + floor(n/3) + floor(2*n/3);
end
(PARI) a(n) = n\2 + n\3 + 2*n\3; \\ Amiram Eldar, Aug 29 2025
CROSSREFS
Sequence in context: A104704 A169884 A341260 * A072726 A343585 A153242
KEYWORD
nonn,easy,changed
AUTHOR
Joost de Winter, Aug 19 2025
STATUS
approved