OFFSET
0,4
COMMENTS
Also the number of compositions of n with all adjacent parts (x, y) satisfying x = 2y or y >= 2x.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
EXAMPLE
The a(1) = 1 through a(9) = 16 compositions:
(1) (2) (3) (4) (5) (6) (7) (8) (9)
(12) (13) (14) (15) (16) (17) (18)
(21) (121) (212) (24) (25) (26) (27)
(42) (124) (125) (36)
(213) (142) (215) (63)
(1212) (214) (242) (126)
(2121) (421) (1214) (216)
(1213) (1421) (1215)
(12121) (21212) (1242)
(2124)
(2142)
(2421)
(4212)
(21213)
(121212)
(212121)
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], And@@Table[#[[i]]>=2*#[[i-1]]||#[[i-1]]==2*#[[i]], {i, 2, Length[#]}]&]], {n, 0, 15}]
(* Second program: *)
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}]];
pred[i_, j_] := i >= 2j || j == 2i;
Join[{1}, c[60, pred]] (* Jean-François Alcover, Jun 10 2021, after Andrew Howroyd *)
PROG
(PARI)
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, ])}
seq(n)={concat([1], C(n, (i, j)->i>=2*j || j==2*i))} \\ Andrew Howroyd, Mar 13 2021
CROSSREFS
The second condition alone gives A154402 for partitions.
The case of equality is A342331.
The version not allowing equality (i.e., strict relations) is A342336.
A224957 counts compositions with adjacent parts x <= 2y and y <= 2x.
A342098 counts partitions with adjacent parts x > 2y.
A342332 counts compositions with adjacent parts x > 2y or y > 2x.
A342333 counts compositions with adjacent parts x >= 2y or y >= 2x.
A342337 counts partitions with adjacent parts x = y or x = 2y.
A342338 counts compositions with adjacent parts x < 2y and y <= 2x.
A342342 counts strict compositions with adjacent parts x <= 2y and y <= 2x.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 10 2021
EXTENSIONS
More terms from Joerg Arndt, Mar 12 2021
STATUS
approved