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.

Showing 1-10 of 16 results. Next

A342339 Heinz numbers of the integer partitions counted by A342337, which have all adjacent parts (x, y) satisfying either x = y or x = 2y.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 16, 17, 18, 19, 21, 23, 24, 25, 27, 29, 31, 32, 36, 37, 41, 42, 43, 47, 48, 49, 53, 54, 59, 61, 63, 64, 65, 67, 71, 72, 73, 79, 81, 83, 84, 89, 96, 97, 101, 103, 107, 108, 109, 113, 121, 125, 126, 127, 128, 131, 133, 137
Offset: 1

Views

Author

Gus Wiseman, Mar 11 2021

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), giving a bijective correspondence between positive integers and integer partitions.

Examples

			The sequence of terms together with their prime indices begins:
      1: {}            19: {8}             48: {1,1,1,1,2}
      2: {1}           21: {2,4}           49: {4,4}
      3: {2}           23: {9}             53: {16}
      4: {1,1}         24: {1,1,1,2}       54: {1,2,2,2}
      5: {3}           25: {3,3}           59: {17}
      6: {1,2}         27: {2,2,2}         61: {18}
      7: {4}           29: {10}            63: {2,2,4}
      8: {1,1,1}       31: {11}            64: {1,1,1,1,1,1}
      9: {2,2}         32: {1,1,1,1,1}     65: {3,6}
     11: {5}           36: {1,1,2,2}       67: {19}
     12: {1,1,2}       37: {12}            71: {20}
     13: {6}           41: {13}            72: {1,1,1,2,2}
     16: {1,1,1,1}     42: {1,2,4}         73: {21}
     17: {7}           43: {14}            79: {22}
     18: {1,2,2}       47: {15}            81: {2,2,2,2}
		

Crossrefs

The first condition alone gives A000961 (perfect powers).
The second condition alone is counted by A154402.
These partitions are counted by A342337.
A018819 counts partitions into powers of 2.
A000929 counts partitions with adjacent parts x >= 2y.
A002843 counts compositions with adjacent parts x <= 2y.
A045690 counts sets with maximum n in with adjacent elements y < 2x.
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).
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.
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
    Select[Range[100],With[{y=PrimePi/@First/@FactorInteger[#]},And@@Table[y[[i]]==y[[i-1]]||y[[i]]==2*y[[i-1]],{i,2,Length[y]}]]&]

A040039 First differences of A033485; also A033485 with terms repeated.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 5, 5, 7, 7, 10, 10, 13, 13, 18, 18, 23, 23, 30, 30, 37, 37, 47, 47, 57, 57, 70, 70, 83, 83, 101, 101, 119, 119, 142, 142, 165, 165, 195, 195, 225, 225, 262, 262, 299, 299, 346, 346, 393, 393, 450, 450, 507, 507, 577, 577, 647, 647, 730, 730, 813, 813, 914, 914, 1015, 1015, 1134, 1134, 1253, 1253, 1395, 1395
Offset: 0

Views

Author

Keywords

Comments

Apparently a(n) = number of partitions (p_1, p_2, ..., p_k) of n+1, with p_1 >= p_2 >= ... >= p_k, such that for each i, p_i > p_{i+1}+...+p_k. - John McKay (mac(AT)mathstat.concordia.ca), Mar 06 2009
Comment from John McKay confirmed in paper by Bessenrodt, Olsson, and Sellers. Such partitions are called "strongly decreasing" partitions in the paper, see the function s(n) therein.
Also the number of unlabeled binary rooted trees with 2*n + 3 nodes in which the two branches directly under any given non-leaf node are either equal or at least one of them is a leaf. - Gus Wiseman, Oct 08 2018
From Gus Wiseman, Apr 06 2021: (Start)
This sequence counts both of the following essentially equivalent things:
1. Sets of distinct positive integers with maximum n + 1 in which all adjacent elements have quotients < 1/2. For example, the a(0) = 1 through a(8) = 7 subsets are:
{1} {2} {3} {4} {5} {6} {7} {8} {9}
{1,3} {1,4} {1,5} {1,6} {1,7} {1,8} {1,9}
{2,5} {2,6} {2,7} {2,8} {2,9}
{3,7} {3,8} {3,9}
{1,3,7} {1,3,8} {4,9}
{1,3,9}
{1,4,9}
2. Sets of distinct positive integers with maximum n + 1 whose first differences are term-wise greater than their decapitation (remove the maximum). For example, the set q = {1,4,9} has first differences (3,5), which are greater than (1,4), so q is counted under a(8). On the other hand, r = {1,5,9} has first differences (4,4), which are not greater than (1,5), so r is not counted under a(8).
Also the number of partitions of n + 1 into powers of 2 covering an initial interval of powers of 2. For example, the a(0) = 1 through a(8) = 7 partitions are:
1 11 21 211 221 2211 421 4211 4221
111 1111 2111 21111 2221 22211 22221
11111 111111 22111 221111 42111
211111 2111111 222111
1111111 11111111 2211111
21111111
111111111
(End)

Examples

			From _Joerg Arndt_, Dec 17 2012: (Start)
The a(19-1)=30 strongly decreasing partitions of 19 are (in lexicographic order)
[ 1]    [ 10 5 3 1 ]
[ 2]    [ 10 5 4 ]
[ 3]    [ 10 6 2 1 ]
[ 4]    [ 10 6 3 ]
[ 5]    [ 10 7 2 ]
[ 6]    [ 10 8 1 ]
[ 7]    [ 10 9 ]
[ 8]    [ 11 5 2 1 ]
[ 9]    [ 11 5 3 ]
[10]    [ 11 6 2 ]
[11]    [ 11 7 1 ]
[12]    [ 11 8 ]
[13]    [ 12 4 2 1 ]
[14]    [ 12 4 3 ]
[15]    [ 12 5 2 ]
[16]    [ 12 6 1 ]
[17]    [ 12 7 ]
[18]    [ 13 4 2 ]
[19]    [ 13 5 1 ]
[20]    [ 13 6 ]
[21]    [ 14 3 2 ]
[22]    [ 14 4 1 ]
[23]    [ 14 5 ]
[24]    [ 15 3 1 ]
[25]    [ 15 4 ]
[26]    [ 16 2 1 ]
[27]    [ 16 3 ]
[28]    [ 17 2 ]
[29]    [ 18 1 ]
[30]    [ 19 ]
The a(20-1)=30 strongly decreasing partitions of 20 are obtained by adding 1 to the first part in each partition in the list.
(End)
From _Gus Wiseman_, Oct 08 2018: (Start)
The a(-1) = 1 through a(4) = 3 semichiral binary rooted trees:
  o  (oo)  (o(oo))  ((oo)(oo))  (o((oo)(oo)))  ((o(oo))(o(oo)))
                    (o(o(oo)))  (o(o(o(oo))))  (o(o((oo)(oo))))
                                               (o(o(o(o(oo)))))
(End)
		

Crossrefs

Cf. A000123.
The equal case is A001511.
The reflected version is A045690.
The unequal (anti-run) version is A045691.
A000929 counts partitions with all adjacent parts x >= 2y.
A002843 counts compositions with all adjacent parts x <= 2y.
A018819 counts partitions into powers of 2.
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).
A342096 counts partitions without adjacent x >= 2y (strict: A342097).
A342098 counts partitions with all adjacent parts x > 2y.
A342337 counts partitions with all adjacent parts x = y or x = 2y.

Programs

  • Maple
    # For example, the five partitions of 4, written in nonincreasing order, are
    # [1,1,1,1], [2,1,1], [2,2], [3,1], [4].
    # Only the last two satisfy the condition, and a(3)=2.
    # The Maple program below verifies this for small values of n.
    with(combinat); N:=8; a:=array(1..N); c:=array(1..N);
    for n from 1 to N do p:=partition(n); np:=nops(p); t:=0;
    for s to np do r:=p[s]; r:=sort(r,`>`); nr:=nops(r); j:=1;
    while jsum(r[k],k=j+1..nr) do j:=j+1;od; # gives A040039
    #while j= sum(r[k],k=j+1..nr) do j:=j+1;od; # gives A018819
    if j=nr then t:=t+1;fi od; a[n]:=t; od;
    # John McKay
  • Mathematica
    T[n_, m_] := T[n, m] = Sum[Binomial[n-2k-1, n-2k-m] Sum[Binomial[m, i] T[k, i], {i, 1, k}], {k, 0, (n-m)/2}] + Binomial[n-1, n-m];
    a[n_] := T[n+1, 1];
    Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Jul 27 2018, after Vladimir Kruchinin *)
    Table[Length[Select[Subsets[Range[n]],MemberQ[#,n]&&And@@Table[#[[i-1]]/#[[i]]<1/2,{i,2,Length[#]}]&]],{n,15}] (* Gus Wiseman, Apr 06 2021 *)
  • Maxima
    T(n,m):=sum(binomial(n-2*k-1,n-2*k-m)*sum(binomial(m,i)*T(k,i),i,1,k),k,0,(n-m)/2)+binomial(n-1,n-m);
    makelist(T(n+1,1),n,0,40); /* Vladimir Kruchinin, Mar 19 2015 */
    
  • PARI
    /* compute as "A033485 with terms repeated" */
    b(n) = if(n<2, 1, b(floor(n/2))+b(n-1));  /* A033485 */
    a(n) = b(n\2+1); /* note different offsets */
    for(n=0,99, print1(a(n),", ")); /* Joerg Arndt, Jan 21 2011 */
    
  • Python
    from itertools import islice
    from collections import deque
    def A040039_gen(): # generator of terms
        aqueue, f, b, a = deque([2]), True, 1, 2
        yield from (1, 1, 2, 2)
        while True:
            a += b
            yield from (a, a)
            aqueue.append(a)
            if f: b = aqueue.popleft()
            f = not f
    A040039_list = list(islice(A040039_gen(),40)) # Chai Wah Wu, Jun 07 2022

Formula

Let T(x) be the g.f, then T(x) = 1 + x/(1-x)*T(x^2) = 1 + x/(1-x) * ( 1 + x^2/(1-x^2) * ( 1 + x^4/(1-x^4) * ( 1 + x^8/(1-x^8) *(...) ))). [Joerg Arndt, May 11 2010]
From Joerg Arndt, Oct 02 2013: (Start)
G.f.: sum(k>=1, x^(2^k-1) / prod(j=0..k-1, 1-x^(2^k) ) ) [Bessenrodt/Olsson/Sellers].
G.f.: 1/(2*x^2) * ( 1/prod(k>=0, 1 - x^(2^k) ) - (1 + x) ).
a(n) = 1/2 * A018819(n+2).
(End)
a(n) = T(n+1,1), where T(n,m)=sum(k..0,(n-m)/2, binomial(n-2*k-1,n-2*k-m)*sum(i=1..k, binomial(m,i)*T(k,i)))+binomial(n-1,n-m). - Vladimir Kruchinin, Mar 19 2015
Using offset 1: a(1) = 1; a(n even) = a(n-1); a(n odd) = a(n-1) + a((n-1)/2). - Gus Wiseman, Oct 08 2018

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

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
Showing 1-10 of 16 results. Next