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.

Previous Showing 11-20 of 23 results. Next

A342330 Number of compositions of n with all adjacent parts (x,y) satisfying x < 2y and y < 2x.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 4, 7, 9, 11, 17, 23, 32, 44, 63, 91, 127, 180, 255, 363, 516, 732, 1044, 1485, 2109, 3002, 4277, 6089, 8660, 12323, 17550, 24986, 35562, 50628, 72084, 102616, 146077, 207980, 296114, 421555, 600153, 854469, 1216543, 1731983, 2465842, 3510713
Offset: 0

Views

Author

Gus Wiseman, Mar 09 2021

Keywords

Comments

Each quotient of adjacent parts is between 1/2 and 2 exclusive.

Examples

			The a(1) = 1 through a(9) = 11 partitions:
  1   2    3     4      5       6        7         8          9
      11   111   22     23      33       34        35         45
                 1111   32      222      43        44         54
                        11111   111111   223       53         234
                                         232       233        333
                                         322       323        432
                                         1111111   332        2223
                                                   2222       2232
                                                   11111111   2322
                                                              3222
                                                              111111111
		

Crossrefs

The version allowing equality is A224957.
The unordered version (partitions) is A342096, with strict case A342097.
Reversing operators and changing 'and' into 'or' gives A342332.
The version allowing partial equality is A342338.
The strict case is A342341.
A000929 counts partitions with all adjacent parts x >= 2y.
A002843 counts compositions with all adjacent parts x <= 2y.
A154402 counts partitions with all adjacent parts x = 2y.
A274199 counts compositions with all adjacent parts x < 2y.
A342094 counts partitions with all adjacent parts x <= 2y (strict: A342095).
A342098 counts partitions with all adjacent parts x > 2y.
A342331 counts compositions where each part is twice or half the prior.
A342335 counts compositions with all adjacent parts x >= 2y or y = 2x.
A342337 counts compositions with all adjacent parts x = y or x = 2y.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, j)
          , j=`if`(i=0, 1..n, floor(i/2)+1..min(n, 2*i-1))))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..45);  # 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,0,15}]
    (* Second program: *)
    b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n - j, j], {j, If[i == 0, 1, Floor[i/2] + 1], If[i == 0, n, Min[n, 2i - 1]]}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 45] (* Jean-François Alcover, May 09 2021, after Alois P. Heinz *)
  • 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

Extensions

Terms a(31) and beyond from Andrew Howroyd, Mar 13 2021

A342331 Number of compositions of n where each part after the first is either twice or half the prior part.

Original entry on oeis.org

1, 1, 1, 3, 2, 2, 5, 4, 3, 9, 6, 4, 14, 9, 8, 22, 15, 11, 37, 24, 21, 58, 40, 30, 95, 67, 53, 157, 114, 85, 264, 187, 147, 428, 315, 244, 732, 527, 410, 1207, 892, 681, 2034, 1490, 1155, 3416, 2508, 1927, 5731, 4215, 3259, 9597, 7091, 5454, 16175, 11914, 9194, 27134, 20033, 15425, 45649, 33672, 25967, 76714
Offset: 0

Views

Author

Gus Wiseman, Mar 09 2021

Keywords

Comments

All quotients of adjacent parts are either 1/2 or 2.

Examples

			The a(1) =  1 through a(12) = 14 compositions (A = 10, B = 11, C = 12):
  1  2  3   4    5    6     7      8      9       A        B        C
        12  121  212  24    124    242    36      424      21242    48
        21            42    421    21212  63      12124    24212    84
                      1212  12121         1242    12421    2121212  363
                      2121                2124    42121             2424
                                          2421    1212121           4242
                                          4212                      121242
                                          121212                    124212
                                          212121                    212124
                                                                    212421
                                                                    242121
                                                                    421212
                                                                    12121212
                                                                    21212121
		

Crossrefs

The unordered version (partitions) is A154402.
The version allowing equality is A342340.
A000929 counts partitions with all adjacent parts x >= 2y.
A002843 counts compositions with all adjacent parts x <= 2y.
A224957 counts compositions with all x <= 2y and y <= 2x (strict: A342342).
A274199 counts compositions with all adjacent parts x < 2y.
A342094 counts partitions with all adjacent x <= 2y (strict: A342095).
A342096 counts partitions with no adjacent x >= 2y (strict: A342097).
A342098 counts partitions with all adjacent parts x > 2y.
A342330 counts compositions with all x < 2y and y < 2x (strict: A342341).
A342332 counts compositions with all adjacent parts x > 2y or y > 2x.
A342333 counts compositions with adjacent parts x >= 2y or y >= 2x.
A342335 counts compositions with all adjacent parts x >= 2y or y = 2x.
A342337 counts partitions with all adjacent parts x = y or x = 2y.
A342338 counts compositions with all 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, select(t-> t::integer and t<=n, {2*i, i/2}))))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..80);  # Alois P. Heinz, Mar 14 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, If[i == 0, Range[n], Select[{2i, i/2}, IntegerQ[#] && # <= n &]]}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 80] (* Jean-François Alcover, May 09 2021, after Alois P. Heinz *)
  • PARI
    seq(n)={my(M=matid(n)); for(k=1, n, for(i=1, k-1, M[i, k] = if(i%2==0,M[i/2,k-i]) + if(i*3<=k, M[i*2,k-i]))); concat([1], sum(q=1, n, M[q, ]))} \\ Andrew Howroyd, Mar 13 2021

Extensions

More terms from Joerg Arndt, Mar 12 2021

A342332 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, 1, 3, 4, 4, 7, 12, 17, 23, 34, 51, 75, 111, 164, 239, 350, 520, 767, 1123, 1652, 2439, 3587, 5263, 7745, 11411, 16789, 24695, 36347, 53489, 78686, 115779, 170390, 250711, 368866, 542783, 798713, 1175208, 1729189, 2544462, 3744077, 5509068, 8106165, 11927785, 17550956, 25824938, 37999743, 55914293, 82274088, 121060721
Offset: 0

Views

Author

Gus Wiseman, Mar 10 2021

Keywords

Examples

			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)
		

Crossrefs

The unordered version (partitions) is A342098.
Reversing operators and changing 'or' into 'and' gives A342330 (strict: A342341).
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.
A224957 counts compositions with x <= 2y and y <= 2x (strict: A342342).
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).
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=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 *)

Extensions

More terms from Joerg Arndt, Mar 12 2021

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

A342335 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, 3, 3, 7, 9, 9, 16, 21, 22, 36, 47, 51, 77, 101, 114, 165, 217, 251, 350, 459, 540, 733, 962, 1152, 1535, 2010, 2437, 3207, 4192, 5141, 6698, 8728, 10802, 13979, 18170, 22652, 29169, 37814, 47410, 60854, 78716, 99144, 126974, 163897, 207159, 264918, 341331, 432606, 552693, 711013, 903041, 1153060
Offset: 0

Views

Author

Gus Wiseman, Mar 10 2021

Keywords

Comments

Also the number of compositions of n with all adjacent parts (x, y) satisfying x = 2y or y >= 2x.

Examples

			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)
		

Crossrefs

The first condition alone gives A002843, or A000929 for partitions.
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.
A224957 counts compositions with x <= 2y and y <= 2x (strict: A342342).
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).
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.

Programs

  • 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 *)
  • 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

Extensions

More terms from Joerg Arndt, Mar 12 2021

A342336 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, 2, 2, 2, 4, 6, 5, 6, 8, 10, 12, 15, 19, 22, 25, 28, 37, 41, 46, 62, 72, 79, 95, 113, 123, 144, 176, 200, 232, 268, 311, 363, 412, 485, 577, 658, 743, 875, 999, 1126, 1338, 1562, 1767, 2034, 2365, 2691, 3088, 3596, 4152, 4785, 5479, 6310, 7273, 8304, 9573, 11136, 12799, 14619, 16910, 19425, 22142, 25579
Offset: 0

Views

Author

Gus Wiseman, Mar 10 2021

Keywords

Comments

Also the number of compositions of n with all adjacent parts (x, y) satisfying x = 2y or y > 2x.

Examples

			The a(1) = 1 through a(12) = 12 compositions (A = 10, B = 11, C = 12):
  1   2   3    4    5    6     7     8      9      A       B       C
          21   13   14   15    16    17     18     19      1A      1B
                         42    25    26     27     28      29      2A
                         213   142   215    63     37      38      39
                               214   1421   216    163     137     84
                               421          2142   217     218     138
                                                   4213    263     219
                                                   21421   425     426
                                                           4214    1425
                                                           14213   2163
                                                                   4215
                                                                   14214
		

Crossrefs

The first condition alone gives A274199, or A342098 for partitions.
The second condition alone gives A154402 for partitions.
The case of equality is A342331.
The version allowing equality (i.e., non-strict relations) is A342335.
A000929 counts partitions with adjacent parts x >= 2y.
A002843 counts compositions with adjacent parts x <= 2y.
A224957 counts compositions with x <= 2y and y <= 2x (strict: A342342).
A342094 counts partitions with adjacent parts x <= 2y (strict: A342095).
A342096 counts partitions without adjacent x >= 2y (strict: A342097).
A342330 counts compositions with x < 2y and y < 2x (strict: A342341).
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.

Programs

  • Maple
    b:= proc(n, x) option remember; `if`(n=0, 1, add(
         `if`(x=0 or x>2*y or y=2*x, b(n-y, y), 0), y=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..80);  # Alois P. Heinz, Mar 14 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_, x_] := b[n, x] = If[n == 0, 1, Sum[
         If[x == 0 || x > 2y || y == 2x, b[n-y, y], 0], {y, 1, n}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 80] (* Jean-François Alcover, May 09 2021, after Alois P. Heinz *)
  • PARI
    \\ See PARI link. David A. Corneth, Mar 12 2021
    
  • 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

Extensions

More terms from Joerg Arndt, Mar 12 2021

A342338 Number of compositions of n with all adjacent parts (x, y) satisfying x < 2y and y <= 2x.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 8, 12, 17, 24, 34, 51, 73, 106, 155, 224, 328, 477, 695, 1013, 1477, 2154, 3140, 4578, 6673, 9728, 14176, 20663, 30113, 43882, 63940, 93167, 135747, 197776, 288138, 419773, 611522, 890829, 1297685, 1890305, 2753505, 4010804, 5842113, 8509462
Offset: 0

Views

Author

Gus Wiseman, Mar 11 2021

Keywords

Comments

Also the number of compositions of n with all adjacent parts (x, y) satisfying x <= 2y and y < 2x.

Examples

			The a(1) = 1 through a(7) = 12 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)
       (11)  (21)   (22)    (23)     (33)      (34)
             (111)  (211)   (32)     (42)      (43)
                    (1111)  (221)    (222)     (223)
                            (2111)   (321)     (232)
                            (11111)  (2211)    (322)
                                     (21111)   (421)
                                     (111111)  (2221)
                                               (3211)
                                               (22111)
                                               (211111)
                                               (1111111)
		

Crossrefs

The first condition alone gives A274199.
The second condition alone gives A002843.
Reversing operators and changing 'and' to 'or' gives A342334.
The version with both relations strict is A342341.
The version with neither relation strict is A342342.
A000929 counts partitions with adjacent parts x >= 2y.
A002843 counts compositions with adjacent parts x <= 2y.
A154402 counts partitions with adjacent parts x = 2y.
A224957 counts compositions with x <= 2y and y <= 2x.
A274199 counts compositions with adjacent parts x < 2y.
A342094 counts partitions with adjacent 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.
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.
A342337 counts partitions with adjacent parts x = y or x = 2y.

Programs

  • 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 *)
  • 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

Extensions

Terms a(21) and beyond from Andrew Howroyd, Mar 13 2021

A342340 Number of compositions of n where each part after the first is either twice, half, or equal to the prior part.

Original entry on oeis.org

1, 1, 2, 4, 6, 9, 17, 24, 41, 67, 109, 173, 296, 469, 781, 1284, 2109, 3450, 5713, 9349, 15422, 25351, 41720, 68590, 112982, 185753, 305752, 503041, 827819, 1361940, 2241435, 3687742, 6068537, 9985389, 16431144, 27036576, 44489533, 73205429, 120460062, 198214516, 326161107
Offset: 0

Views

Author

Gus Wiseman, Mar 12 2021

Keywords

Examples

			The a(1) = 1 through a(6) = 17 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (12)   (22)    (122)    (24)
             (21)   (112)   (212)    (33)
             (111)  (121)   (221)    (42)
                    (211)   (1112)   (222)
                    (1111)  (1121)   (1122)
                            (1211)   (1212)
                            (2111)   (1221)
                            (11111)  (2112)
                                     (2121)
                                     (2211)
                                     (11112)
                                     (11121)
                                     (11211)
                                     (12111)
                                     (21111)
                                     (111111)
		

Crossrefs

The case of partitions is A342337.
The anti-run version is A342331.
A000929 counts partitions with adjacent parts x >= 2y.
A002843 counts compositions with adjacent parts x <= 2y.
A154402 counts partitions with adjacent parts x = 2y.
A224957 counts compositions with x <= 2y and y <= 2x (strict: A342342).
A274199 counts compositions with adjacent parts x < 2y.
A342094 counts partitions with adjacent 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).
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.
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}, select(x->
           x::integer and x<=n, {i/2, i, 2*i}))))
        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]]==#[[i-1]]||#[[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, If[i == 0, Range[n], Select[ {i/2, i, 2 i}, IntegerQ[#] && # <= n &]]}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 42] (* Jean-François Alcover, Jun 10 2021, after Alois P. Heinz *)
  • PARI
    seq(n)={my(M=matid(n)); for(k=1, n, for(i=1, k-1, M[i, k] = if(i%2==0, M[i/2,k-i]) + if(i*2<=k, M[i,k-i]) + if(i*3<=k, M[i*2,k-i]))); concat([1], sum(q=1, n, M[q, ]))} \\ Andrew Howroyd, Mar 13 2021

Extensions

Terms a(21) and beyond from Andrew Howroyd, Mar 13 2021

A342341 Number of strict compositions of n with all adjacent parts (x, y) satisfying x < 2y and y < 2x.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 3, 3, 5, 5, 5, 9, 7, 13, 15, 17, 19, 29, 31, 39, 43, 63, 59, 75, 121, 119, 169, 167, 199, 279, 305, 343, 479, 537, 733, 789, 883, 1057, 1421, 1545, 1831, 2409, 2577, 3343, 4001, 4657, 5131, 6065, 7755, 8841, 10473, 12995, 14659, 17671, 20619, 25157, 28255, 33131, 38265, 47699, 53171, 62611, 80005, 88519, 105937, 119989
Offset: 0

Views

Author

Gus Wiseman, Mar 12 2021

Keywords

Comments

Each quotient of adjacent parts is between 1/2 and 2 exclusive.

Examples

			The a(1) = 1 through a(17) = 17 compositions (A..G = 10..16):
  1  2  3  4  5   6  7   8   9    A    B   C    D    E     F     G
              23     34  35  45   46   47  57   58   59    69    6A
              32     43  53  54   64   56  75   67   68    78    79
                             234  235  65  345  76   86    87    97
                             432  532  74  354  85   95    96    A6
                                           435  346  347   357   358
                                           453  643  356   456   457
                                           534       653   465   475
                                           543       743   546   547
                                                     2345  564   574
                                                     2354  645   745
                                                     4532  654   754
                                                     5432  753   853
                                                           2346  2347
                                                           6432  2356
                                                                 6532
                                                                 7432
		

Crossrefs

The unordered version (partitions) is A342097 (non-strict: A342096).
The non-strict version is A342330.
The version allowing equality is A342342 (non-strict: A224957).
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.
A342094 counts partitions with adjacent x <= 2y (strict: A342095).
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.
A342337 counts partitions with adjacent parts x = y or x = 2y.
A342338 counts compositions with adjacent parts x < 2y and y <= 2x.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&],And@@Table[#[[i]]<2*#[[i-1]]&&#[[i-1]]<2*#[[i]],{i,2,Length[#]}]&]],{n,0,15}]

Extensions

More terms from Bert Dobbelaere, Mar 19 2021

A342334 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, 2, 3, 4, 6, 11, 16, 23, 35, 54, 82, 125, 193, 294, 447, 680, 1037, 1580, 2408, 3676, 5606, 8544, 13024, 19860, 30277, 46155, 70374, 107300, 163586, 249397, 380235, 579705, 883810, 1347467, 2054371, 3132102, 4775211, 7280321, 11099613, 16922503, 25800136, 39335052, 59970425, 91431195
Offset: 0

Views

Author

Gus Wiseman, Mar 10 2021

Keywords

Comments

Also the number of compositions of n with all adjacent parts (x, y) satisfying x > 2y or y >= 2x.

Examples

			The a(1) = 1 through a(8) = 16 compositions:
  (1)  (2)  (3)   (4)   (5)    (6)    (7)     (8)
            (12)  (13)  (14)   (15)   (16)    (17)
                  (31)  (41)   (24)   (25)    (26)
                        (131)  (51)   (52)    (62)
                               (141)  (61)    (71)
                               (312)  (124)   (125)
                                      (151)   (152)
                                      (241)   (161)
                                      (313)   (251)
                                      (412)   (314)
                                      (1312)  (413)
                                              (512)
                                              (1241)
                                              (1313)
                                              (1412)
                                              (3131)
		

Crossrefs

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

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]>=2*#[[i-1]]||#[[i-1]]>2*#[[i]],{i,2,Length[#]}]&]],{n,0,15}]

Extensions

More terms from Joerg Arndt, Mar 12 2021
Previous Showing 11-20 of 23 results. Next