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.

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

This page as a plain text file.
%I A342330 #23 May 09 2021 11:25:15
%S A342330 1,1,2,2,3,4,4,7,9,11,17,23,32,44,63,91,127,180,255,363,516,732,1044,
%T A342330 1485,2109,3002,4277,6089,8660,12323,17550,24986,35562,50628,72084,
%U A342330 102616,146077,207980,296114,421555,600153,854469,1216543,1731983,2465842,3510713
%N A342330 Number of compositions of n with all adjacent parts (x,y) satisfying x < 2y and y < 2x.
%C A342330 Each quotient of adjacent parts is between 1/2 and 2 exclusive.
%H A342330 Alois P. Heinz, <a href="/A342330/b342330.txt">Table of n, a(n) for n = 0..2000</a> (first 1001 terms from Andrew Howroyd)
%e A342330 The a(1) = 1 through a(9) = 11 partitions:
%e A342330   1   2    3     4      5       6        7         8          9
%e A342330       11   111   22     23      33       34        35         45
%e A342330                  1111   32      222      43        44         54
%e A342330                         11111   111111   223       53         234
%e A342330                                          232       233        333
%e A342330                                          322       323        432
%e A342330                                          1111111   332        2223
%e A342330                                                    2222       2232
%e A342330                                                    11111111   2322
%e A342330                                                               3222
%e A342330                                                               111111111
%p A342330 b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, j)
%p A342330       , j=`if`(i=0, 1..n, floor(i/2)+1..min(n, 2*i-1))))
%p A342330     end:
%p A342330 a:= n-> b(n, 0):
%p A342330 seq(a(n), n=0..45);  # _Alois P. Heinz_, Mar 15 2021
%t A342330 Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]<2*#[[i-1]]&&#[[i-1]]<2*#[[i]],{i,2,Length[#]}]&]],{n,0,15}]
%t A342330 (* Second program: *)
%t A342330 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]]}]];
%t A342330 a[n_] := b[n, 0];
%t A342330 a /@ Range[0, 45] (* _Jean-François Alcover_, May 09 2021, after _Alois P. Heinz_ *)
%o A342330 (PARI)
%o A342330 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, ])}
%o A342330 seq(n)={concat([1], C(n, (i,j)->i<2*j && j<2*i))} \\ _Andrew Howroyd_, Mar 13 2021
%Y A342330 The version allowing equality is A224957.
%Y A342330 The unordered version (partitions) is A342096, with strict case A342097.
%Y A342330 Reversing operators and changing 'and' into 'or' gives A342332.
%Y A342330 The version allowing partial equality is A342338.
%Y A342330 The strict case is A342341.
%Y A342330 A000929 counts partitions with all adjacent parts x >= 2y.
%Y A342330 A002843 counts compositions with all adjacent parts x <= 2y.
%Y A342330 A154402 counts partitions with all adjacent parts x = 2y.
%Y A342330 A274199 counts compositions with all adjacent parts x < 2y.
%Y A342330 A342094 counts partitions with all adjacent parts x <= 2y (strict: A342095).
%Y A342330 A342098 counts partitions with all adjacent parts x > 2y.
%Y A342330 A342331 counts compositions where each part is twice or half the prior.
%Y A342330 A342335 counts compositions with all adjacent parts x >= 2y or y = 2x.
%Y A342330 A342337 counts compositions with all adjacent parts x = y or x = 2y.
%Y A342330 Cf. A003114, A003242, A034296, A167606, A342083, A342084, A342087, A342191, A342333, A342334, A342336, A342339, A342340.
%K A342330 nonn
%O A342330 0,3
%A A342330 _Gus Wiseman_, Mar 09 2021
%E A342330 Terms a(31) and beyond from _Andrew Howroyd_, Mar 13 2021