login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A342338 Number of compositions of n with all adjacent parts (x, y) satisfying x < 2y and y <= 2x. 14

%I #13 Jun 10 2021 20:36:45

%S 1,1,2,3,4,6,8,12,17,24,34,51,73,106,155,224,328,477,695,1013,1477,

%T 2154,3140,4578,6673,9728,14176,20663,30113,43882,63940,93167,135747,

%U 197776,288138,419773,611522,890829,1297685,1890305,2753505,4010804,5842113,8509462

%N Number of compositions of n with all adjacent parts (x, y) satisfying x < 2y and y <= 2x.

%C Also the number of compositions of n with all adjacent parts (x, y) satisfying x <= 2y and y < 2x.

%H Andrew Howroyd, <a href="/A342338/b342338.txt">Table of n, a(n) for n = 0..1000</a>

%e The a(1) = 1 through a(7) = 12 compositions:

%e (1) (2) (3) (4) (5) (6) (7)

%e (11) (21) (22) (23) (33) (34)

%e (111) (211) (32) (42) (43)

%e (1111) (221) (222) (223)

%e (2111) (321) (232)

%e (11111) (2211) (322)

%e (21111) (421)

%e (111111) (2221)

%e (3211)

%e (22111)

%e (211111)

%e (1111111)

%t Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]<2*#[[i-1]]&&#[[i-1]]<=2*#[[i]],{i,2,Length[#]}]&]],{n,0,15}]

%t (* Second program: *)

%t 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 pred[i_, j_] := i < 2j && j <= 2i;

%t Join[{1}, c[60, pred]] (* _Jean-François Alcover_, Jun 10 2021, after _Andrew Howroyd_ *)

%o (PARI)

%o 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 seq(n)={concat([1], C(n, (i,j)->i<2*j && j<=2*i))} \\ _Andrew Howroyd_, Mar 13 2021

%Y The first condition alone gives A274199.

%Y The second condition alone gives A002843.

%Y Reversing operators and changing 'and' to 'or' gives A342334.

%Y The version with both relations strict is A342341.

%Y The version with neither relation strict is A342342.

%Y A000929 counts partitions with adjacent parts x >= 2y.

%Y A002843 counts compositions with adjacent parts x <= 2y.

%Y A154402 counts partitions with adjacent parts x = 2y.

%Y A224957 counts compositions with x <= 2y and y <= 2x.

%Y A274199 counts compositions with adjacent parts x < 2y.

%Y A342094 counts partitions with adjacent x <= 2y (strict: A342095).

%Y A342096 counts partitions without adjacent x >= 2y (strict: A342097).

%Y A342098 counts partitions with adjacent parts x > 2y.

%Y A342330 counts compositions with x < 2y and y < 2x.

%Y A342331 counts compositions with adjacent parts x = 2y or y = 2x.

%Y A342332 counts compositions with adjacent parts x > 2y or y > 2x.

%Y A342333 counts compositions with adjacent parts x >= 2y or y >= 2x.

%Y A342335 counts compositions with adjacent parts x >= 2y or y = 2x.

%Y A342337 counts partitions with adjacent parts x = y or x = 2y.

%Y Cf. A003114, A003242, A034296, A167606, A342083, A342084, A342087, A342191, A342336, A342340.

%K nonn

%O 0,3

%A _Gus Wiseman_, Mar 11 2021

%E Terms a(21) and beyond from _Andrew Howroyd_, Mar 13 2021

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 17 22:31 EDT 2024. Contains 375237 sequences. (Running on oeis4.)