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.
%I A335464 #13 May 21 2021 04:16:45 %S A335464 0,0,0,1,1,3,8,18,39,86,188,406,865,1836,3874,8135,17003,35413,73516, %T A335464 152171,314151,647051,1329936,2728341,5587493,11424941,23327502, %U A335464 47567628,96879029,197090007,400546603,813258276,1649761070,3343936929,6772740076,13707639491 %N A335464 Number of compositions of n with a run of length > 2. %C A335464 A composition of n is a finite sequence of positive integers summing to n. %C A335464 Also compositions contiguously matching the pattern (1,1,1). %F A335464 a(n) = A011782(n) - A128695(n). - _Alois P. Heinz_, Jul 06 2020 %e A335464 The a(3) = 1 through a(7) = 18 compositions: %e A335464 (111) (1111) (1112) (222) (1114) %e A335464 (2111) (1113) (1222) %e A335464 (11111) (3111) (2221) %e A335464 (11112) (4111) %e A335464 (11121) (11113) %e A335464 (12111) (11122) %e A335464 (21111) (11131) %e A335464 (111111) (13111) %e A335464 (21112) %e A335464 (22111) %e A335464 (31111) %e A335464 (111112) %e A335464 (111121) %e A335464 (111211) %e A335464 (112111) %e A335464 (121111) %e A335464 (211111) %e A335464 (1111111) %p A335464 b:= proc(n, t) option remember; `if`(n=0, 1, add(`if`(abs(t)<>j, %p A335464 b(n-j, j), `if`(t=-j, 0, b(n-j, -j))), j=1..n)) %p A335464 end: %p A335464 a:= n-> ceil(2^(n-1))-b(n, 0): %p A335464 seq(a(n), n=0..40); # _Alois P. Heinz_, Jul 06 2020 %t A335464 Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],MatchQ[#,{___,x_,x_,x_,___}]&]],{n,0,10}] %t A335464 (* Second program: *) %t A335464 b[n_, t_] := b[n, t] = If[n == 0, 1, Sum[If[Abs[t] != j, %t A335464 b[n - j, j], If[t == -j, 0, b[n - j, -j]]], {j, 1, n}]]; %t A335464 a[n_] := Ceiling[2^(n-1)] - b[n, 0]; %t A335464 a /@ Range[0, 40] (* _Jean-François Alcover_, May 21 2021, after _Alois P. Heinz_ *) %Y A335464 Compositions contiguously avoiding (1,1) are A003242. %Y A335464 Compositions with some part > 2 are A008466. %Y A335464 Compositions by number of adjacent equal parts are A106356. %Y A335464 Compositions where each part is adjacent to an equal part are A114901. %Y A335464 Compositions contiguously avoiding (1,1,1) are A128695. %Y A335464 Compositions with adjacent parts coprime are A167606. %Y A335464 Compositions contiguously matching (1,1) are A261983. %Y A335464 Compositions with all equal parts contiguous are A274174. %Y A335464 Patterns contiguously matched by compositions are A335457. %Y A335464 Cf. A005251, A011782, A056986, A032020, A131044, A178470, A242882, A335455, A335458. %K A335464 nonn %O A335464 0,6 %A A335464 _Gus Wiseman_, Jul 06 2020 %E A335464 a(23)-a(35) from _Alois P. Heinz_, Jul 06 2020