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 A309937 #10 Aug 24 2019 02:26:30 %S A309937 2,0,2,0,2,2,0,0,4,2,0,2,0,2,0,2,0,6,0,4,0,2,2,0,6,0,0,2,0,8,2,0,8,0, %T A309937 2,0,4,0,12,0,2,0,6,0,10,0,2,0,16,0,2,2,0,6,0,20,0,0,4,0,18,0,12,2,0, %U A309937 8,0,30,0,2,0,2,0,16,0,30,0,2,0,6,0,40,0,14,0,4,0,20,0,52,0,2 %N A309937 Irregular triangle read by rows: T(n,k) is the number of compositions of n with 2k parts and circular differences all equal to 1 or -1, (n >= 3, 1 <= k <= n/3). %C A309937 All values are even since the parts must alternate between even and odd and therefore a composition is never equal to its reversal. %C A309937 The longest compositions will consist of alternating 1's and 2's. The number of parts cannot then exceed n / 3. %e A309937 Triangle begins: %e A309937 2; %e A309937 0; %e A309937 2; %e A309937 0, 2; %e A309937 2, 0; %e A309937 0, 4; %e A309937 2, 0, 2; %e A309937 0, 2, 0; %e A309937 2, 0, 6; %e A309937 0, 4, 0, 2; %e A309937 2, 0, 6, 0; %e A309937 0, 2, 0, 8; %e A309937 2, 0, 8, 0, 2; %e A309937 0, 4, 0, 12, 0; %e A309937 2, 0, 6, 0, 10; %e A309937 0, 2, 0, 16, 0, 2; %e A309937 2, 0, 6, 0, 20, 0; %e A309937 0, 4, 0, 18, 0, 12; %e A309937 2, 0, 8, 0, 30, 0, 2; %e A309937 0, 2, 0, 16, 0, 30, 0; %e A309937 2, 0, 6, 0, 40, 0, 14; %e A309937 0, 4, 0, 20, 0, 52, 0, 2; %e A309937 2, 0, 6, 0, 42, 0, 42, 0; %e A309937 0, 2, 0, 16, 0, 78, 0, 16; %e A309937 2, 0, 8, 0, 50, 0, 84, 0, 2; %e A309937 0, 4, 0, 18, 0, 96, 0, 56, 0; %e A309937 2, 0, 6, 0, 50, 0, 140, 0, 18; %e A309937 0, 2, 0, 16, 0, 116, 0, 128, 0, 2; %e A309937 ... %e A309937 For n = 11 there are a total of 8 compositions: %e A309937 k = 1: (56), (65) %e A309937 k = 3: (121232), (123212), (212123), (212321), (232121), (321212) %o A309937 (PARI) %o A309937 step(R,n)={matrix(n,n,i,j, if(i>j, if(j>1, R[i-j,j-1]) + if(j+1<=n, R[i-j,j+1])))} %o A309937 T(n)={my(v=vector(n\3)); for(k=1, n, my(R=matrix(n,n,i,j,i==j&&abs(i-k)==1), m=0); while(R, m++; if(m%2==0, v[m/2]+=R[n,k]); R=step(R,n))); v} %o A309937 for(n=3, 24, print(T(n))) %Y A309937 Row sums are A325589. %Y A309937 Cf. A309931, A309938, A309939, A325558, A325590. %K A309937 nonn,tabf %O A309937 3,1 %A A309937 _Andrew Howroyd_, Aug 23 2019