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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

0, 1, 4, 9, 18, 34, 62, 110, 192, 331, 565, 958, 1615, 2710, 4531, 7552, 12554, 20823, 34472, 56972, 94020, 154959, 255102, 419532, 689312, 1131632, 1856382, 3043208, 4985674, 8163321, 13359207, 21851594, 35726470, 58386958, 95383471, 155766277, 254288786
Offset: 0

Views

Author

Steven Finch, Mar 18 2020

Keywords

Comments

A bitstring is solus if all of its 1's are isolated.
The number of these bitstrings is A000045(n+2).

Examples

			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.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, w, m, s) option remember; `if`(n=0, m,
          b(n-1, w+1, max(m, w+1), irem(s, 10)*10+0)+
         `if`(s in [01, 21], 0, b(n-1, 0, m, irem(s, 10)*10+1)))
        end:
    a:= n-> b(n, 0, 0, 22):
    seq(a(n), n=0..39);  # Alois P. Heinz, Mar 18 2020
  • Mathematica
    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]]];
    a[n_] := b[n, 0, 0, 22];
    a /@ Range[0, 39] (* Jean-François Alcover, Aug 21 2020, after Alois P. Heinz *)

Formula

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)).

A333396 Total length of all longest runs of 0's in multus bitstrings of length n.

Original entry on oeis.org

1, 2, 5, 11, 23, 45, 87, 165, 309, 573, 1056, 1934, 3527, 6408, 11605, 20960, 37771, 67928, 121949, 218595, 391302, 699610, 1249475, 2229329, 3974083, 7078658, 12599318, 22410548, 39837420, 70775727, 125675525, 223052519, 395702395, 701695820, 1243827018, 2204007329
Offset: 1

Views

Author

Steven Finch, Mar 18 2020

Keywords

Comments

A bitstring is multus if each of its 1's possess at least one neighboring 1.
The number of these bitstrings is A005251(n+2).

Examples

			a(4) = 11 because the seven multus bitstrings of length 4 are 0000, 1100, 0110, 0011, 1110, 0111, 1111 and the longest 0-runs contribute 4+2+1+2+1+1+0 = 11.
		

Crossrefs

Formula

G.f.: x*Sum_{k>=1} (1+x^2)/(1-2*x+x^2-x^3)-(1+x^2-x^(k-1)+x^k-2*x^(k+1))/(1-2*x+x^2-x^3+x^(k+2)).
Showing 1-2 of 2 results.