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.

A143291 Triangle T(n,k), n>=2, 0<=k<=n-2, read by rows: numbers of binary words of length n containing at least one subword 10^{k}1 and no subwords 10^{i}1 with i

This page as a plain text file.
%I A143291 #27 Jun 02 2025 13:27:39
%S A143291 1,3,1,8,2,1,19,4,2,1,43,8,3,2,1,94,15,5,3,2,1,201,27,9,4,3,2,1,423,
%T A143291 48,15,6,4,3,2,1,880,84,24,10,5,4,3,2,1,1815,145,38,16,7,5,4,3,2,1,
%U A143291 3719,248,60,24,11,6,5,4,3,2,1,7582,421,94,35,17,8,6,5,4,3,2,1,15397,710,146,51,25,12,7,6,5,4,3,2,1
%N A143291 Triangle T(n,k), n>=2, 0<=k<=n-2, read by rows: numbers of binary words of length n containing at least one subword 10^{k}1 and no subwords 10^{i}1 with i<k.
%C A143291 T(n,k) = number of subset S of {1,2,...,n+1} such that |S| > 1 and min(S*) = k, where S* is the set {x(2)-x(1), x(3)-x(2), ..., x(h+1)-x(h)} when the elements of S are written as x(1) < x(2) < ... < x(h+1); if max(S*) is used in place of min(S*), the result is the array at A255874. - _Clark Kimberling_, Mar 08 2015
%H A143291 Alois P. Heinz, <a href="/A143291/b143291.txt">Rows n = 2..142, flattened</a>
%F A143291 G.f. of column k: x^(k+2) / ((x^(k+1)+x-1)*(x^(k+2)+x-1)).
%e A143291 T (5,1) = 4, because there are 4 words of length 5 containing at least one subword 101 and no subword 11: 00101, 01010, 10100, 10101.
%e A143291 Triangle begins:
%e A143291     1;
%e A143291     3,  1;
%e A143291     8,  2,  1;
%e A143291    19,  4,  2, 1;
%e A143291    43,  8,  3, 2, 1;
%e A143291    94, 15,  5, 3, 2, 1;
%e A143291   201, 27,  9, 4, 3, 2, 1;
%e A143291   423, 48, 15, 6, 4, 3, 2, 1;
%p A143291 as:= proc (n, k) option remember;
%p A143291        if k=0 then 2^n
%p A143291      elif n<=k and n>=0 then n+1
%p A143291      elif n>0 then as(n-1, k) +as(n-k-1, k)
%p A143291      else as(n+1+k, k) -as(n+k, k)
%p A143291        fi
%p A143291      end:
%p A143291 T:= (n, k)-> as(n, k) -as(n, k+1):
%p A143291 seq(seq(T(n, k), k=0..n-2), n=2..15);
%t A143291 as[n_, k_] := as[n, k] = Which[ k == 0, 2^n, n <= k && n >= 0, n+1, n > 0, as[n-1, k] + as[n-k-1, k], True, as[n+1+k, k] - as[n+k, k] ]; t [n_, k_] := as[n, k] - as[n, k+1]; Table[Table[t[n, k], {k, 0, n-2}], {n, 2, 14}] // Flatten (* _Jean-François Alcover_, Dec 11 2013, translated from Maple *)
%o A143291 (Magma)
%o A143291 R<x>:= PowerSeriesRing(Integers(), 50);
%o A143291 A143291:= func< n,k | Coefficient(R!( x^k/((x^(k-1) +x-1)*(x^k +x-1)) ), n) >;
%o A143291 [A143291(n,k): k in [2..n], n in [2..12]]; // _G. C. Greubel_, Jun 01 2025
%o A143291 (SageMath)
%o A143291 @CachedFunction
%o A143291 def b(n,k):
%o A143291     if k==0: return 2^n
%o A143291     elif n <= k and n>=0: return n+1
%o A143291     elif n>0: return b(n-1,k) + b(n-k-1,k)
%o A143291     else: return b(n+k+1,k) - b(n+k,k)
%o A143291 def A143291(n,k): return b(n,k) - b(n,k+1)
%o A143291 print(flatten([[A143291(n,k) for k in range(n-1)] for n in range(2,16)])) # _G. C. Greubel_, Jun 01 2025
%Y A143291 Columns k=0-10 give: A008466, A143281, A143282, A143283, A143284, A143285, A143286, A143287, A143288, A143289, A143290.
%Y A143291 Row sums are in A000295.
%Y A143291 Cf. A141539.
%K A143291 nonn,tabl
%O A143291 2,2
%A A143291 _Alois P. Heinz_, Aug 04 2008