OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
EXAMPLE
The a(1) = 1 through a(9) = 10 partitions:
1 2 3 4 5 6 7 8 9
11 21 22 221 33 421 44 63
111 211 2111 42 2221 422 333
1111 11111 222 22111 2222 4221
2211 211111 4211 22221
21111 1111111 22211 42111
111111 221111 222111
2111111 2211111
11111111 21111111
111111111
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, j),
j=`if`(i=0, 1..n, select(x-> x<=n, [i, 2*i]))))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..80); # Alois P. Heinz, May 24 2021
MATHEMATICA
Table[Length[Select[IntegerPartitions[n], And@@Table[#[[i]]==#[[i-1]]||#[[i-1]]==2*#[[i]], {i, 2, Length[#]}]&]], {n, 0, 30}]
(* Second program: *)
b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n - j, j],
{j, If[i == 0, Range[n], Select[{i, 2i}, # <= n&]]}]];
a[n_] := b[n, 0];
a /@ Range[0, 80] (* Jean-François Alcover, Jun 03 2021, after Alois P. Heinz *)
CROSSREFS
The first condition alone gives A000005 (for partitions).
The second condition alone gives A154402 (for partitions).
The Heinz numbers of these partitions are given by A342339.
A000929 counts partitions with adjacent parts x >= 2y.
A002843 counts compositions with adjacent parts x <= 2y.
A274199 counts compositions with adjacent parts x < 2y.
A342098 counts partitions with adjacent parts x > 2y.
A342331 counts compositions with adjacent parts x = 2y or y = 2x.
A342332 counts compositions with adjacent parts x > 2y or y > 2x.
A342333 counts compositions with adjacent parts x >= 2y or y >= 2x.
A342335 counts compositions with adjacent parts x >= 2y or y = 2x.
A342338 counts compositions with adjacent parts x < 2y and y <= 2x.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 10 2021
STATUS
approved