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
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)
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.
A342098 counts partitions with adjacent parts x > 2y.
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.
Cf.
A000005,
A003114,
A003242,
A034296,
A167606,
A342083,
A342084,
A342087,
A342191,
A342336,
A342339.
-
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
-
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 *)
-
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
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
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
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.
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.
Cf.
A003114,
A003242,
A034296,
A167606,
A342083,
A342084,
A342087,
A342191,
A342334,
A342336,
A342339,
A342340.
-
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}]
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
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)
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).
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.
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]>=2*#[[i-1]]||#[[i-1]]>2*#[[i]],{i,2,Length[#]}]&]],{n,0,15}]
A342342
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, 3, 1, 3, 5, 5, 3, 11, 9, 11, 17, 15, 29, 39, 31, 39, 65, 57, 107, 127, 149, 155, 187, 265, 293, 419, 523, 571, 781, 763, 941, 1371, 1387, 2125, 2383, 2775, 3243, 4189, 4555, 5349, 7241, 7997, 10591, 13171, 14581, 17213, 20253, 25177, 27701, 34317
Offset: 0
The a(1) = 1 through a(12) = 17 strict compositions (A = 10, B = 11, C = 12):
1 2 3 4 5 6 7 8 9 A B C
12 23 24 34 35 36 46 47 48
21 32 42 43 53 45 64 56 57
123 124 54 235 65 75
321 421 63 532 74 84
234 1234 236 246
243 1243 245 345
324 3421 542 354
342 4321 632 435
423 1235 453
432 5321 534
543
642
1236
1245
5421
6321
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.
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.
Cf.
A003114,
A003242,
A034296,
A167606,
A342083,
A342084,
A342087,
A342191,
A342334,
A342336,
A342340.
-
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}]
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
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}
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.
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.
A342338 counts compositions with adjacent parts x < 2y and y <= 2x.
A342342 counts strict compositions with adjacent parts x <= 2y and y <= 2x.
Cf.
A003114,
A003242,
A034296,
A040039,
A167606.
A342083,
A342084,
A342087,
A342191,
A342336,
A342339,
A342340.
-
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]}]]&]
Comments