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.
%I A384717 #48 Aug 29 2025 10:15:15 %S A384717 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, %T A384717 38,40,41,42,45,45,47,49,50,51,54,54,56,58,59,60,63,63,65,67,68,69,72, %U A384717 72,74,76,77,78,81,81,83,85,86,87,90 %N A384717 Sum of floored squared chord lengths from -1 to the 2n-th roots of unity (upper semicircle, endpoints excluded). %C A384717 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. %C A384717 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. %C A384717 If one includes the endpoints (k = 0 and k = n), the resulting total is a(n) + 4. %H A384717 Paolo Xausa, <a href="/A384717/b384717.txt">Table of n, a(n) for n = 1..10000</a> %H A384717 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,1,0,-1). %F A384717 a(n) = floor(n/2) + floor(n/3) + floor(2*n/3). %e A384717 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. %e A384717 Check with the closed form: floor(10/2) + floor(10/3) + floor(20/3) = 5 + 3 + 6 = 14. %t A384717 A384717[n_] := Quotient[n, 2] + Quotient[n, 3] + Quotient[2*n, 3]; %t A384717 Array[A384717, 100] (* _Paolo Xausa_, Aug 28 2025 *) %o A384717 (MATLAB) %o A384717 function an = euler_chord_term(n) %o A384717 an = floor(n/2) + floor(n/3) + floor(2*n/3); %o A384717 end %o A384717 (PARI) a(n) = n\2 + n\3 + 2*n\3; \\ _Amiram Eldar_, Aug 29 2025 %Y A384717 Cf. A010761, A004523. %K A384717 nonn,easy,new %O A384717 1,2 %A A384717 _Joost de Winter_, Aug 19 2025