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.

A129922 Number of 3-Carlitz compositions of n (or, more generally p-Carlitz compositions, p > 1), i.e., words b_1^{i_1}b_2^{i_2}...b_k^{i_k} such that the b_j's and i_j's are positive integers for which Sum_{j=1..k} i_j * b_j = n and, for all j, i_j < p and if b_j = b_(j+1) then i_j + i_(j+1) is not equal to p.

This page as a plain text file.
%I A129922 #18 Nov 10 2020 12:35:59
%S A129922 1,1,3,4,12,22,51,101,225,465,1008,2111,4528,9560,20402,43222,92018,
%T A129922 195256,415243,881758,1874288,3981318,8460906,17975132,38196045,
%U A129922 81152769,172436680,366376845,778476016,1654054258,3514494256,7467412436,15866507485,33712418692,71630875356,152198161794
%N A129922 Number of 3-Carlitz compositions of n (or, more generally p-Carlitz compositions, p > 1), i.e., words b_1^{i_1}b_2^{i_2}...b_k^{i_k} such that the b_j's and i_j's are positive integers for which Sum_{j=1..k} i_j * b_j = n and, for all j, i_j < p and if b_j = b_(j+1) then i_j + i_(j+1) is not equal to p.
%C A129922 For p=2, the sequence enumerates Carlitz compositions, A003242.
%H A129922 Alois P. Heinz, <a href="/A129922/b129922.txt">Table of n, a(n) for n = 0..1000</a>
%H A129922 Sylvie Corteel and Paweł Hitczenko, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL10/Hitczenko/hitczenko4.html">Generalizations of Carlitz Compositions</a>, Journal of Integer Sequences, Vol. 10 (2007), Article 07.8.8.
%F A129922 G.f.: 1/(1 - Sum_{k>0} (z^k/(1-z^k) - 3*z^(k*3)/(1-z^(k*3)))).
%F A129922 For general p the generating function is 1/(1 - Sum_{k>0}(z^k/(1-z^k) - p*z^(k*p)/(1-z^(k*p)))).
%e A129922 a(3)=4 because, for p=3, we can write:
%e A129922   3^{1},
%e A129922   1^{1} 2^{1},
%e A129922   2^{1} 1^{1},
%e A129922   1^{1} 1^{1} 1^{1}.
%p A129922 b:= proc(n, i, j) option remember;
%p A129922      `if`(n=0, 1, add(add(`if`(k=i and m+j=3, 0,
%p A129922       b(n-k*m, k, m)), m=1..min(2, n/k)), k=1..n))
%p A129922     end:
%p A129922 a:= n-> b(n, 0$2):
%p A129922 seq(a(n), n=0..40);  # _Alois P. Heinz_, Jul 22 2017
%t A129922 b[n_, i_, j_] := b[n, i, j] = If[n == 0, 1, Sum[Sum[If[k == i && m + j == 3, 0, b[n - k m, k, m]], {m, 1, Min[2, n/k]}], {k, 1, n}]];
%t A129922 a[n_] := b[n, 0, 0];
%t A129922 a /@ Range[0, 40] (* _Jean-François Alcover_, Nov 10 2020, after _Alois P. Heinz_ *)
%o A129922 (PARI) N = 66;  x = 'x + O('x^N);  p=3;
%o A129922 gf = 1/(1-sum(k=1,N, x^k/(1-x^k)-p*x^(k*p)/(1-x^(k*p))));
%o A129922 Vec(gf)  /* _Joerg Arndt_, Apr 28 2013 */
%Y A129922 Cf. A129921.
%Y A129922 Cf. A003242.
%K A129922 nonn
%O A129922 0,3
%A A129922 Pawel Hitczenko (phitczenko(AT)math.drexel.edu), Jun 05 2007
%E A129922 Added more terms, _Joerg Arndt_, Apr 28 2013