%I #29 Sep 08 2022 08:44:49
%S 2,5,12,22,38,59,88,124,170,225,292,370,462,567,688,824,978,1149,1340,
%T 1550,1782,2035,2312,2612,2938,3289,3668,4074,4510,4975,5472,6000,
%U 6562,7157,7788,8454,9158,9899,10680,11500,12362,13265,14212,15202,16238
%N Expansion of x^2*(2 - x + x^2) / ((1 + x)*(1 - x)^4).
%C Equals (d(n)-r(n))/2, where d = A006527 and r is the periodic sequence with fundamental period (0,1,0,1).
%C Consider any of the permutations of (1,2,3,...,n) as p(1),p(2),p(3),...,p(n). Then take the sum S of products formed from the permutation as S = p(1)*p(2) + p(2)*p(3) + p(3)*p(4) +... + p(n-1)*p(n). This sequence represents the minimum possible S. - _Leroy Quet_ and _Rainer Rosenthal_, Jan 30 2005
%C From _Dmitry Kamenetsky_, Dec 15 2006: (Start)
%C This sequence is related to A101986, except here we take the minimum sum of products of successive pairs. Here is a method for generating such permutations. Start with two lists, the first has numbers 1 to n, while the second is empty.
%C Repeat the following operations until the first list is empty:
%C 1. Move the largest number of the first list to the leftmost available position in the second list. The move operation removes the original number from the first list.
%C 2. Move the largest number of the first list to the rightmost available position in the second list.
%C 3. Move the smallest number of the first list to the leftmost available position in the second list.
%C 4. Move the smallest number of the first list to the rightmost available position in the second list. For example when n=8, the permutation is 8, 1, 6, 3, 4, 5, 2, 7.
%C (End)
%H M. Benoumhani, M. Kolli, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL13/Benoumhani/benoumhani6.html">Finite topologies and partitions</a>, JIS 13 (2010) # 10.3.5, t_{N0}(n,5) in theorem 5.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-2,3,-1).
%F a(n) = (2*n^3 + 4*n - 3 + 3*(-1)^n)/12. - _Ralf Stephan_, Jan 30 2005.
%F a(2)=2, a(3)=5, a(4)=12, a(5)=22, a(6)=38; for n>6, a(n) = 3*a(n-1) - 2*a(n-2) - 2*a(n-3) + 3*a(n-4) - a(n-5). - _Harvey P. Dale_, May 31 2013
%F a(n) = binomial(n,3) + floor(n^2/2). - _Bruno Berselli_, Jun 08 2017
%t CoefficientList[Series[(2 - x + x^2)/((1 + x) (1 - x)^4), {x, 0, 45}], x] (* _Robert G. Wilson v_, Jan 29 2005 *)
%t LinearRecurrence[{3, -2, -2, 3, -1}, {2, 5, 12, 22, 38}, 50] (* _Harvey P. Dale_, May 31 2013 *)
%t Table[(2 n^3 + 4 n - 3 + 3 (-1)^n)/12, {n, 2, 50}] (* _Bruno Berselli_, Jun 08 2017 *)
%o (Magma) [Binomial(n,3)+Floor(n^2/2): n in [2..50]]; // _Bruno Berselli_, Jun 08 2017
%Y Cf. A101986.
%K nonn,easy
%O 2,1
%A _Clark Kimberling_
%E Corrected by _Ralf Stephan_, Jan 09 2005
|