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 A342338 #13 Jun 10 2021 20:36:45 %S A342338 1,1,2,3,4,6,8,12,17,24,34,51,73,106,155,224,328,477,695,1013,1477, %T A342338 2154,3140,4578,6673,9728,14176,20663,30113,43882,63940,93167,135747, %U A342338 197776,288138,419773,611522,890829,1297685,1890305,2753505,4010804,5842113,8509462 %N A342338 Number of compositions of n with all adjacent parts (x, y) satisfying x < 2y and y <= 2x. %C A342338 Also the number of compositions of n with all adjacent parts (x, y) satisfying x <= 2y and y < 2x. %H A342338 Andrew Howroyd, <a href="/A342338/b342338.txt">Table of n, a(n) for n = 0..1000</a> %e A342338 The a(1) = 1 through a(7) = 12 compositions: %e A342338 (1) (2) (3) (4) (5) (6) (7) %e A342338 (11) (21) (22) (23) (33) (34) %e A342338 (111) (211) (32) (42) (43) %e A342338 (1111) (221) (222) (223) %e A342338 (2111) (321) (232) %e A342338 (11111) (2211) (322) %e A342338 (21111) (421) %e A342338 (111111) (2221) %e A342338 (3211) %e A342338 (22111) %e A342338 (211111) %e A342338 (1111111) %t A342338 Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]<2*#[[i-1]]&&#[[i-1]]<=2*#[[i]],{i,2,Length[#]}]&]],{n,0,15}] %t A342338 (* Second program: *) %t A342338 c[n_, pred_] := Module[{M = IdentityMatrix[n], i, k}, For[k = 1, k <= n, k++, For[i = 1, i <= k - 1, i++, M[[i, k]] = Sum[If[pred[j, i], M[[j, k - i]], 0], {j, 1, k - i}]]]; Sum[M[[q, All]], {q, 1, n}]]; %t A342338 pred[i_, j_] := i < 2j && j <= 2i; %t A342338 Join[{1}, c[60, pred]] (* _Jean-François Alcover_, Jun 10 2021, after _Andrew Howroyd_ *) %o A342338 (PARI) %o A342338 C(n, pred)={my(M=matid(n)); for(k=1, n, for(i=1, k-1, M[i, k]=sum(j=1, k-i, if(pred(j, i), M[j, k-i], 0)))); sum(q=1, n, M[q, ])} %o A342338 seq(n)={concat([1], C(n, (i,j)->i<2*j && j<=2*i))} \\ _Andrew Howroyd_, Mar 13 2021 %Y A342338 The first condition alone gives A274199. %Y A342338 The second condition alone gives A002843. %Y A342338 Reversing operators and changing 'and' to 'or' gives A342334. %Y A342338 The version with both relations strict is A342341. %Y A342338 The version with neither relation strict is A342342. %Y A342338 A000929 counts partitions with adjacent parts x >= 2y. %Y A342338 A002843 counts compositions with adjacent parts x <= 2y. %Y A342338 A154402 counts partitions with adjacent parts x = 2y. %Y A342338 A224957 counts compositions with x <= 2y and y <= 2x. %Y A342338 A274199 counts compositions with adjacent parts x < 2y. %Y A342338 A342094 counts partitions with adjacent x <= 2y (strict: A342095). %Y A342338 A342096 counts partitions without adjacent x >= 2y (strict: A342097). %Y A342338 A342098 counts partitions with adjacent parts x > 2y. %Y A342338 A342330 counts compositions with x < 2y and y < 2x. %Y A342338 A342331 counts compositions with adjacent parts x = 2y or y = 2x. %Y A342338 A342332 counts compositions with adjacent parts x > 2y or y > 2x. %Y A342338 A342333 counts compositions with adjacent parts x >= 2y or y >= 2x. %Y A342338 A342335 counts compositions with adjacent parts x >= 2y or y = 2x. %Y A342338 A342337 counts partitions with adjacent parts x = y or x = 2y. %Y A342338 Cf. A003114, A003242, A034296, A167606, A342083, A342084, A342087, A342191, A342336, A342340. %K A342338 nonn %O A342338 0,3 %A A342338 _Gus Wiseman_, Mar 11 2021 %E A342338 Terms a(21) and beyond from _Andrew Howroyd_, Mar 13 2021