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.

A333394 Total length of all longest runs of 0's in solus bitstrings of length n.

This page as a plain text file.
%I A333394 #22 Aug 21 2020 05:49:05
%S A333394 0,1,4,9,18,34,62,110,192,331,565,958,1615,2710,4531,7552,12554,20823,
%T A333394 34472,56972,94020,154959,255102,419532,689312,1131632,1856382,
%U A333394 3043208,4985674,8163321,13359207,21851594,35726470,58386958,95383471,155766277,254288786
%N A333394 Total length of all longest runs of 0's in solus bitstrings of length n.
%C A333394 A bitstring is solus if all of its 1's are isolated.
%C A333394 The number of these bitstrings is A000045(n+2).
%H A333394 Alois P. Heinz, <a href="/A333394/b333394.txt">Table of n, a(n) for n = 0..1000</a>
%H A333394 Steven Finch, <a href="https://arxiv.org/abs/2003.09458">Cantor-solus and Cantor-multus distributions</a>, arXiv:2003.09458 [math.CO], 2020.
%F A333394 G.f.: Sum_{k>=1} (1+x)/(1-x-x^2)-(1+x-x^k-x^(k+1))/(1-x-x^2+x^(k+1)).
%e A333394 a(4) = 18 because the A000045(6) = 8 solus bitstrings of length 4 are 0000, 1000, 0100, 0010, 0001, 1010, 0101, 1001 and the longest 0-runs contribute 4+3+2+2+3+1+1+2 = 18.
%p A333394 b:= proc(n, w, m, s) option remember; `if`(n=0, m,
%p A333394       b(n-1, w+1, max(m, w+1), irem(s, 10)*10+0)+
%p A333394      `if`(s in [01, 21], 0, b(n-1, 0, m, irem(s, 10)*10+1)))
%p A333394     end:
%p A333394 a:= n-> b(n, 0, 0, 22):
%p A333394 seq(a(n), n=0..39);  # _Alois P. Heinz_, Mar 18 2020
%t A333394 b[n_, w_, m_, s_] := b[n, w, m, s] = If[n == 0, m, b[n-1, w+1, Max[m, w+1], Mod[s, 10]*10+0]+If[MatchQ[s, 01|21], 0, b[n-1, 0, m, Mod[s, 10]*10+1]]];
%t A333394 a[n_] := b[n, 0, 0, 22];
%t A333394 a /@ Range[0, 39] (* _Jean-François Alcover_, Aug 21 2020, after _Alois P. Heinz_ *)
%Y A333394 Cf. A000045, A119706, A333395, A333396.
%K A333394 nonn
%O A333394 0,3
%A A333394 _Steven Finch_, Mar 18 2020