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.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (0,1,1,0,-1).
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
KEYWORD
nonn,easy,changed
AUTHOR
Joost de Winter, Aug 19 2025
STATUS
approved
