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.

A342333 Number of compositions of n with all adjacent parts (x, y) satisfying x >= 2y or y >= 2x.

Original entry on oeis.org

1, 1, 1, 3, 4, 5, 10, 18, 26, 42, 72, 114, 184, 305, 494, 799, 1305, 2123, 3446, 5611, 9134, 14851, 24162, 39314, 63945, 104025, 169238, 275305, 447863, 728592, 1185248, 1928143, 3136706, 5102743, 8301086, 13504175, 21968436, 35737995, 58138282, 94578751, 153859673
Offset: 0

Views

Author

Gus Wiseman, Mar 10 2021

Keywords

Comments

Either quotient x/y or y/x must be >= 2.

Examples

			The a(1) =  1 through a(7) = 18 compositions:
  (1)  (2)  (3)   (4)    (5)    (6)     (7)
            (12)  (13)   (14)   (15)    (16)
            (21)  (31)   (41)   (24)    (25)
                  (121)  (131)  (42)    (52)
                         (212)  (51)    (61)
                                (141)   (124)
                                (213)   (142)
                                (312)   (151)
                                (1212)  (214)
                                (2121)  (241)
                                        (313)
                                        (412)
                                        (421)
                                        (1213)
                                        (1312)
                                        (2131)
                                        (3121)
                                        (12121)
		

Crossrefs

The unordered version (partitions) is A000929.
Reversing operators and changing 'or' into 'and' gives A224957 (strict: A342342).
The version not allowing equality (i.e., strict relations) is A342332.
The version allowing partial equality is A342334.
A002843 counts compositions with adjacent parts x <= 2y.
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.
A342330 counts compositions with x < 2y and y < 2x (strict: A342341).
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.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, j), j=
          `if`(i=0, 1..n, {$1..min(n, iquo(i, 2)), $(2*i)..n})))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..42);  # 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, If[i == 0, Sum[b[n-j, j], {j, 1, n}], Sum[b[n-j, j], {j, Range[Min[n, Quotient[i, 2]]]~Union~Range[2i, n]}]]];
    a[n_] := b[n, 0];
    a /@ Range[0, 42] (* Jean-François Alcover, Jun 10 2021, after_Alois P. Heinz_ *)

Extensions

More terms from Joerg Arndt, Mar 12 2021