%I #48 Apr 04 2024 10:55:32
%S 2,4,12,20,38,56,88,120,170,220,292,364,462,560,688,816,978,1140,1340,
%T 1540,1782,2024,2312,2600,2938,3276,3668,4060,4510,4960,5472,5984,
%U 6562,7140,7788,8436,9158,9880,10680,11480,12362,13244,14212,15180,16238,17296,18448,19600,20850,22100
%N Row sums of A168281.
%C The atomic numbers of the augmented alkaline earth group in Charles Janet's spiral periodic table are 0 and the first eight terms of this sequence (see Stewart reference). - _Alonso del Arte_, May 13 2011
%C Maximum number of 123 patterns in an alternating permutation of length n+3. - _Lara Pudwell_, Jun 09 2019
%H Vincenzo Librandi, <a href="/A168380/b168380.txt">Table of n, a(n) for n = 1..10000</a>
%H Robert Dougherty-Bliss, <a href="https://sites.math.rutgers.edu/~zeilberg/Theses/RobertDoughertyBlissThesis.pdf">Experimental Methods in Number Theory and Combinatorics</a>, Ph. D. Dissertation, Rutgers Univ. (2024). See p. 4.
%H Lara Pudwell, <a href="http://faculty.valpo.edu/lpudwell/slides/PP2019Pudwell.pdf">Packing patterns in restricted permutations</a>, 2019.
%H Lara Pudwell, <a href="https://www.ams.org/journals/notices/202007/rnoti-p994.pdf">From permutation patterns to the periodic table</a>, Notices of the American Mathematical Society. 67.7 (2020), 994-1001.
%H Philip Stewart, <a href="http://dx.doi.org/10.1007/s10698-008-9062-5">Charles Janet: unrecognized genius of the Periodic System</a>. Foundations of Chemistry (2010), p. 9.
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1).
%F a(n) = 2*A005993(n-1).
%F a(n) = (n+1)*(3 + 2*n^2 + 4*n - 3*(-1)^n)/12.
%F a(n+1) - a(n) = A093907(n) = A137583(n+1).
%F a(2n+1) = A035597(n+1), a(2n) = A002492(n).
%F a(n) = A099956(n-1), 2 <= n <= 7.
%F a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6).
%F G.f.: 2*x*(1 + x^2) / ( (1+x)^2*(x-1)^4 ).
%F a(n) = A000292(n) + A027656(n-1). - _Paul Curtz_, Oct 26 2012
%F E.g.f.: (1/12)*(3*(x - 1) + (3 + 15*x + 12*x^2 + 2*x^3)*exp(2*x))*exp(-x). - _G. C. Greubel_, Jul 19 2016
%e From _Lara Pudwell_, Jun 09 2019: (Start)
%e a(1)=2. The alternating permutation of length 1+3=4 with the maximum number of copies of 123 is 1324. The two copies are 124 and 134.
%e a(2)=4. The alternating permutation of length 2+3=5 with the maximum number of copies of 123 is 13254. The four copies are 124, 125, 134, and 135.
%e a(3)=12. The alternating permutation of length 3+3=6 with the maximum number of copies of 123 is 132546. The twelve copies are 124, 125, 126, 134, 135, 136, 146, 156, 246, 256, 346, and 356. (End)
%t LinearRecurrence[{2,1,-4,1,2,-1},{2, 4, 12, 20, 38, 56},50] (* _G. C. Greubel_, Jul 19 2016 *)
%t Table[(n + 1) (3 + 2 n^2 + 4 n - 3 (-1)^n)/12, {n, 50}] (* _Michael De Vlieger_, Jul 20 2016 *)
%o (Magma) [(n+1)*(3+2*n^2+4*n-3*(-1)^n)/12: n in [1..50] ]; // _Vincenzo Librandi_, Aug 06 2011
%o (PARI) a(n)=([0,1,0,0,0,0; 0,0,1,0,0,0; 0,0,0,1,0,0; 0,0,0,0,1,0; 0,0,0,0,0,1; -1,2,1,-4,1,2]^(n-1)*[2;4;12;20;38;56])[1,1] \\ _Charles R Greathouse IV_, Jul 21 2016
%K nonn,easy
%O 1,1
%A _Paul Curtz_, Nov 24 2009