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.

A031878 Maximal number of edges in Hamiltonian path in complete graph on n nodes.

This page as a plain text file.
%I A031878 #28 Jul 31 2018 22:34:03
%S A031878 0,1,3,5,10,13,21,25,36,41,55,61,78,85,105,113,136,145,171,181,210,
%T A031878 221,253,265,300,313,351,365,406,421,465,481,528,545,595,613,666,685,
%U A031878 741,761,820,841,903,925,990,1013,1081,1105,1176,1201,1275,1301,1378
%N A031878 Maximal number of edges in Hamiltonian path in complete graph on n nodes.
%C A031878 Given a regular polygon with n sides, a(n) is the number of circles that have an edge of the polygon as a diameter (5 for n=4, 10 for n=5, 13 for n=6, ...). - _Ahmet Arduç_, Jan 28 2017
%C A031878 Quasipolynomial of order 2. [_Charles R Greathouse IV_, Dec 07 2011]
%H A031878 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).
%F A031878 a(n) = C(n, 2) if n odd, a(n) = C(n, 2)-n/2+1 if n even.
%F A031878 G.f.: x^2*(1+2*x+x^3)/((1-x)*(1-x^2)).
%F A031878 a(n) = ( n*n +n -(n-1)*(n mod 2) )/2. [_Frank Ellermann_]
%e A031878 E.g. for n=4 [1:2][2:3][3:1][1:4][4:2], so a(4) = 5.
%t A031878 LinearRecurrence[{1,2,-2,-1,1},{0,1,3,5,10},60] (* _Harvey P. Dale_, Mar 14 2015 *)
%t A031878 CoefficientList[ Series[-x (x^3 + 2x + 1)/((x - 1)^3 (x + 1)^2), {x, 0, 52}], x]  (* _Robert G. Wilson v_, Jul 30 2018 *)
%o A031878 (PARI) a(n)=if(n%2,n^2-n,n^2-2*n+2)/2  \\ _Charles R Greathouse IV_, Dec 07 2011
%Y A031878 Cf. A031940.
%K A031878 nonn,easy
%O A031878 1,3
%A A031878 _Colin Mallows_