OFFSET
0,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2500
EXAMPLE
The a(1) = 1 through a(9) = 17 compositions:
(1) (2) (3) (4) (5) (6) (7) (8) (9)
(13) (14) (15) (16) (17) (18)
(31) (41) (51) (25) (26) (27)
(131) (141) (52) (62) (72)
(61) (71) (81)
(151) (152) (162)
(313) (161) (171)
(251) (252)
(314) (261)
(413) (315)
(1313) (414)
(3131) (513)
(1314)
(1413)
(3141)
(4131)
(13131)
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, j),
j=select(x-> i=0 or x>2*i or i>2*x , {$1..n})))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..50); # Alois P. Heinz, May 24 2021
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: *)
b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n - j, j], {j, Select[Range[n], i == 0 || # > 2 i || i > 2 # &]}]];
a[n_] := b[n, 0];
a /@ Range[0, 50] (* Jean-François Alcover, Jun 09 2021, after Alois P. Heinz *)
CROSSREFS
The unordered version (partitions) is A342098.
The version allowing equality (i.e., non-strict relations) is A342333.
The version allowing partial equality is counted by A342334.
A000929 counts partitions with adjacent parts x >= 2y.
A002843 counts compositions with adjacent parts x <= 2y.
A154402 counts partitions with adjacent parts x = 2y.
A274199 counts compositions with adjacent parts x < 2y.
A342331 counts compositions with adjacent parts x = 2y or y = 2x.
A342335 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.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 10 2021
EXTENSIONS
More terms from Joerg Arndt, Mar 12 2021
STATUS
approved