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.

A320577 Number of isosceles triangles whose vertices are the vertices of a regular n-gon.

This page as a plain text file.
%I A320577 #52 May 23 2025 10:18:51
%S A320577 1,4,10,8,21,24,30,40,55,52,78,84,95,112,136,132,171,180,196,220,253,
%T A320577 248,300,312,333,364,406,400,465,480,506,544,595,588,666,684,715,760,
%U A320577 820,812,903,924,960,1012,1081,1072,1176,1200,1241,1300,1378,1368,1485
%N A320577 Number of isosceles triangles whose vertices are the vertices of a regular n-gon.
%C A320577 Inspired by question 12 of the Turkish National Mathematics Olympics 2015 (see the link).
%H A320577 Colin Barker, <a href="/A320577/b320577.txt">Table of n, a(n) for n = 3..1000</a>
%H A320577 Turkish Math Olympiad 2015, <a href="/A320577/a320577.jpg">Question 12</a>
%H A320577 <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (-1,1,3,2,-2,-3,-1,1,1).
%F A320577 a(n) = n*(n-1)/2 if n mod 6 = 1 or 5 n*(n-2)/2 if n mod 6 = 2 or 4 n*(3n-7)/6 if n mod 6 = 3 n*(3n-10)/6 otherwise.
%F A320577 Alternatively, with the least absolute modulo 'mods' and m = abs(mods(n, 6)), a(n) = n*(n - k)/2 where k = m if m in {1, 2} and otherwise k = (10 - m)/3. - _Peter Luschny_, Oct 20 2018
%F A320577 From _Colin Barker_, Oct 17 2018: (Start)
%F A320577 G.f.: x^3*(1 + 5*x + 13*x^2 + 11*x^3 + 5*x^4 + x^5) / ((1 - x)^3*(1 + x)^2*(1 + x + x^2)^2).
%F A320577 a(n) = -a(n-1) + a(n-2) + 3*a(n-3) + 2*a(n-4) - 2*a(n-5) - 3*a(n-6) - a(n-7) + a(n-8) + a(n-9) for n>11.
%F A320577 (End)
%F A320577 a(n) = n*floor((n-1)/2)-(2/3)*n*[n==0 (mod 3)]. - _Hoang Xuan Thanh_, May 22 2025
%p A320577 a := proc(n) local m; m := abs(mods(n, 6));
%p A320577 if m = 0 or m = 3 then m := (10 - m)/3 fi; n*(n - m)/2 end:
%p A320577 seq(a(n), n=3..100); # _Peter Luschny_, Oct 20 2018
%t A320577 a[n_]:=If[Mod[n,6]==1 || Mod[n,6]==5, Binomial[n,2], If[Mod[n,6]==2 || Mod[n,6]==4,  n*(n-2)/2 , If[Mod[n,6]==3, n*(3n-7)/6 ,   n*(3n-10)/6 ]]]; Array[a, 20, 3] (* _Stefano Spezia_, Oct 16 2018 *)
%o A320577 (Python)
%o A320577 for n in range(3, 101):
%o A320577     m = n % 6
%o A320577     if m == 1 or m == 5: a = (n*(n-1)) // 2
%o A320577     elif m==2 or m == 4: a = (n*(n-2)) // 2
%o A320577     elif m==3          : a = (n*(3*n-7)) // 6
%o A320577     else               : a = (n*(3*n-10)) // 6
%o A320577     print(a, end=", ")
%o A320577 (PARI) Vec(x^3*(1 + 5*x + 13*x^2 + 11*x^3 + 5*x^4 + x^5) / ((1 - x)^3*(1 + x)^2*(1 + x + x^2)^2) + O(x^40)) \\ _Colin Barker_, Oct 17 2018
%K A320577 nonn,easy
%O A320577 3,2
%A A320577 _Halil Ibrahim Kanpak_, Oct 15 2018