cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A384717 Sum of floored squared chord lengths from -1 to the 2n-th roots of unity (upper semicircle, endpoints excluded).

Original entry on oeis.org

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
Offset: 1

Views

Author

Joost de Winter, Aug 19 2025

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • MATLAB
    function an = euler_chord_term(n)
        an = floor(n/2) + floor(n/3) + floor(2*n/3);
    end
    
  • Mathematica
    A384717[n_] := Quotient[n, 2] + Quotient[n, 3] + Quotient[2*n, 3];
    Array[A384717, 100] (* Paolo Xausa, Aug 28 2025 *)
  • PARI
    a(n) = n\2 + n\3 + 2*n\3; \\ Amiram Eldar, Aug 29 2025

Formula

a(n) = floor(n/2) + floor(n/3) + floor(2*n/3).