cp's OEIS Frontend

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.

A224957 Number of compositions [p(1), p(2), ..., p(k)] of n such that p(j) <= 2*p(j-1) and p(j-1) <= 2*p(j).

Original entry on oeis.org

1, 1, 2, 4, 6, 11, 19, 31, 54, 92, 154, 266, 454, 771, 1319, 2249, 3834, 6550, 11176, 19069, 32558, 55567, 94838, 161891, 276325, 471659, 805102, 1374234, 2345724, 4004031, 6834605, 11666260, 19913668, 33991462, 58021534, 99039592, 169055094, 288567886, 492569833, 840790082
Offset: 0

Views

Author

Joerg Arndt, Apr 21 2013

Keywords

Examples

			There are a(6) = 19 such compositions of 6:
01:  [ 1 1 1 1 1 1 ]
02:  [ 1 1 1 1 2 ]
03:  [ 1 1 1 2 1 ]
04:  [ 1 1 2 1 1 ]
05:  [ 1 1 2 2 ]
06:  [ 1 2 1 1 1 ]
07:  [ 1 2 1 2 ]
08:  [ 1 2 2 1 ]
09:  [ 1 2 3 ]
10:  [ 2 1 1 1 1 ]
11:  [ 2 1 1 2 ]
12:  [ 2 1 2 1 ]
13:  [ 2 2 1 1 ]
14:  [ 2 2 2 ]
15:  [ 2 4 ]
16:  [ 3 2 1 ]
17:  [ 3 3 ]
18:  [ 4 2 ]
19:  [ 6 ]
		

Crossrefs

The case of strict relations is A342330, with strict case A342341.
The strict case is A342342.
A000929 counts partitions with adjacent parts x >= 2y.
A002843 counts compositions with adjacent parts x <= 2y.
A045690 counts sets with maximum n with adjacent elements y < 2x.
A154402 counts partitions with adjacent parts x = 2y.
A274199 counts compositions with adjacent parts x < 2y.
A342094 counts partitions with adjacent parts x <= 2y (strict: A342095).
A342096 counts partitions without adjacent x >= 2y (strict: A342097).
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.
A342334 counts compositions with adjacent parts x >= 2y or y > 2x.
A342335 counts compositions with adjacent parts x >= 2y or y = 2x.
A342336 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.
A342340 counts compositions with adjacent x = y or x = 2y or y = 2x.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(
          b(n-j, j), j=`if`(i=0, 1..n, ceil(i/2)..min(n, 2*i))))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..42);  # Alois P. Heinz, Mar 15 2021
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]<=2*#[[i-1]]&&#[[i-1]]<=2*#[[i]],{i,2,Length[#]}]&]],{n,15}] (* Gus Wiseman, Mar 12 2021 *)
    b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n - j, j], {j, If[i == 0, Range[n], Range[Ceiling[i/2], Min[n, 2*i]]]}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 42] (* Jean-François Alcover, May 24 2021, after Alois P. Heinz *)

Extensions

Name corrected by Gus Wiseman, Mar 11 2021