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.

A293595 Triangle read by rows: T(n,k) = number of compositions of n into k parts such that no two cyclically adjacent parts are equal.

This page as a plain text file.
%I A293595 #15 Jan 19 2018 10:27:04
%S A293595 1,1,0,1,2,0,1,2,0,0,1,4,0,0,0,1,4,6,2,0,0,1,6,6,4,0,0,0,1,6,12,10,0,
%T A293595 0,0,0,1,8,18,16,10,2,0,0,0,1,8,24,40,20,6,0,0,0,0,1,10,30,52,50,18,0,
%U A293595 0,0,0,0,1,10,42,84,90,50,14,2,0,0,0,0
%N A293595 Triangle read by rows: T(n,k) = number of compositions of n into k parts such that no two cyclically adjacent parts are equal.
%C A293595 Compositions of length 1 are included.
%C A293595 See theorem 4 in Hadjicostas reference for generating function.
%H A293595 Andrew Howroyd, <a href="/A293595/b293595.txt">Table of n, a(n) for n = 1..1275</a>
%H A293595 P. Hadjicostas, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL20/Hadjicostas/hadji5.html">Cyclic, dihedral and symmetric Carlitz compositions of a positive integer</a>, Journal of Integer Sequences, 20 (2017), Article 17.8.5.
%F A293595 G.f.: (Sum_{j>=1} x^(2*j)*y^2/(1+x^j*y)) + (Sum_{j>=1} x^j*y/(1+x^j*y)^2) / (1 - Sum_{j>=1} x^j*y/(1+x^j*y)).
%e A293595 Triangle begins:
%e A293595   1;
%e A293595   1,  0;
%e A293595   1,  2,  0;
%e A293595   1,  2,  0,  0;
%e A293595   1,  4,  0,  0,  0;
%e A293595   1,  4,  6,  2,  0,  0;
%e A293595   1,  6,  6,  4,  0,  0,  0;
%e A293595   1,  6, 12, 10,  0,  0,  0,  0;
%e A293595   1,  8, 18, 16, 10,  2,  0,  0,  0;
%e A293595   1,  8, 24, 40, 20,  6,  0,  0,  0,  0;
%e A293595   ...
%e A293595 Case n=6:
%e A293595 The included compositions are:
%e A293595 k=1: 6;                                => T(6,1) = 1
%e A293595 k=2: 15, 24, 42, 51;                   => T(6,2) = 4
%e A293595 k=3: 123, 132, 213, 231, 312, 321;     => T(6,3) = 6
%e A293595 k=4: 1212, 2121;                       => T(6,4) = 2
%t A293595 max = 10; gf = Sum[x^(2*j)*y^2/(1 + x^j*y), {j, 1, max}] + Sum[x^j*y/(1 + x^j*y)^2, {j, 1, max}]/(1 - Sum[ x^j*y/(1 + x^j*y), {j, 1, max}]) + O[x]^(max+1) + O[y]^(max+1) // Normal // Expand;
%t A293595 T[n_, k_] := SeriesCoefficient[gf, {x, 0, n}, {y, 0, k}];
%t A293595 Table[T[n, k], {n, 1, max}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, Jan 19 2018 *)
%o A293595 (PARI)
%o A293595 gf(n,y) = {my(A=sum(j=1, n, x^(2*j)*y^2/(1+x^j*y) + O(x*x^n)),
%o A293595 B=sum(j=1, n, x^j*y/(1+x^j*y)^2 + O(x*x^n)),
%o A293595 C=sum(j=1, n, x^j*y/(1+x^j*y) + O(x*x^n)));
%o A293595 A + B/(1-C)}
%o A293595 for(n=1,10,my(p=polcoeff(gf(n,y),n));for(k=1,n,print1(polcoeff(p,k),", "));print)
%Y A293595 Row sums are in A212322.
%Y A293595 Cf. A106351, A106369.
%K A293595 nonn,tabl
%O A293595 1,5
%A A293595 _Andrew Howroyd_, Oct 12 2017