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 A334778 #16 May 17 2020 13:50:15 %S A334778 1,0,1,0,4,2,0,18,66,6,0,72,1168,1192,88,0,270,16220,61830,33600,1480, %T A334778 0,972,202416,2150688,3821760,1268292,40272,0,3402,2395540,62178928, %U A334778 272509552,279561086,62954948,1476944,0,11664,27517568,1629254640,15313310208,36381368048,24342647424,3963672720,71865728 %N A334778 Triangle read by rows: T(n,k) is the number of permutations of 2 indistinguishable copies of 1..n arranged in a circle with exactly k local maxima. %C A334778 T(n,k) is divisible by n for n > 0. %H A334778 Andrew Howroyd, <a href="/A334778/b334778.txt">Table of n, a(n) for n = 0..1325</a> (rows 0..50) %F A334778 T(n,k) = n*(2*F(2,n-1,k-1,0) + F(2,n-1,k-2,1)) for n > 1 where F(m,n,p,q) = Sum_{i=0..p} Sum_{j=0..min(m-i, q)} F(m, n-1, p-i, q-j+i) * binomial(m+2*(q-j)+1, 2*q+i-j+1) * binomial(q-j+i, i) * binomial(q+1, j) for n > 1 with F(m,1,0,q) = binomial(m-1, q), F(m,1,p,q) = 0 for p > 0. %F A334778 A334780(n) = Sum_{k=1..n} k*T(n,k). %e A334778 Triangle begins: %e A334778 1; %e A334778 0, 1; %e A334778 0, 4, 2; %e A334778 0, 18, 66, 6; %e A334778 0, 72, 1168, 1192, 88; %e A334778 0, 270, 16220, 61830, 33600, 1480; %e A334778 0, 972, 202416, 2150688, 3821760, 1268292, 40272; %e A334778 0, 3402, 2395540, 62178928, 272509552, 279561086, 62954948, 1476944; %e A334778 ... %e A334778 The T(2,1) = 4 permutations of 1122 with 1 local maximum are 1122, 1221, 2112, 2211. %e A334778 The T(2,2) = 2 permutations of 1122 with 2 local maxima are 1212, 2121. %o A334778 (PARI) %o A334778 CircPeaksBySig(sig, D)={ %o A334778 my(F(lev,p,q) = my(key=[lev,p,q], z); if(!mapisdefined(FC, key, &z), %o A334778 my(m=sig[lev]); z = if(lev==1, if(p==0, binomial(m-1, q), 0), sum(i=0, p, sum(j=0, min(m-i, q), self()(lev-1, p-i, q-j+i) * binomial(m+2*(q-j)+1, 2*q+i-j+1) * binomial(q-j+i, i) * binomial(q+1, j) ))); %o A334778 mapput(FC, key, z)); z); %o A334778 local(FC=Map()); %o A334778 vector(#D, i, my(k=D[i], lev=#sig); if(lev==1, k==1, my(m=sig[lev]); lev*sum(j=1, min(m,k), m*binomial(m-1,j-1)*F(lev-1,k-j,j-1)/j))); %o A334778 } %o A334778 Row(n)={ if(n==0, [1], CircPeaksBySig(vector(n,i,2), [0..n])) } %o A334778 { for(n=0, 8, print(Row(n))) } %Y A334778 Columns k=0..6 are A000007, A027261(n-1), A159716, A159717, A159718, A159719, A159720. %Y A334778 Row sums are A000680. %Y A334778 Main diagonal is A334779. %Y A334778 The version for permutations of 1..n is A263789. %Y A334778 Cf. A334218, A334774, A334780. %K A334778 nonn,tabl %O A334778 0,5 %A A334778 _Andrew Howroyd_, May 13 2020