A239873
Number of strict partitions of 2n + 1 having 1 more even part than odd, so that there is at least one ordering of the parts in which the even and odd parts alternate, and the first and last terms are even.
Original entry on oeis.org
0, 0, 0, 1, 2, 4, 6, 9, 12, 16, 20, 25, 30, 36, 43, 51, 61, 74, 91, 113, 144, 184, 239, 311, 407, 530, 692, 895, 1155, 1478, 1882, 2375, 2983, 3715, 4602, 5660, 6925, 8418, 10187, 12257, 14686, 17514, 20809, 24624, 29049, 34154, 40051, 46842, 54668, 63667
Offset: 0
a(7) counts these 9 partitions of 15: [12,1,2], [10,1,4], [10,3,2], [4,9,2], [8,1,6], [8,5,2], [8,3,4], [6,7,2], [6,5,4].
-
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2 or
abs(t)>n, 0, `if`(n=0, 1, b(n, i-1, t)+
`if`(i>n, 0, b(n-i, i-1, t+(2*irem(i, 2)-1)))))
end:
a:= n-> b(2*n+1$2, 1):
seq(a(n), n=0..80); # Alois P. Heinz, Apr 02 2014
-
d[n_] := Select[IntegerPartitions[n], Max[Length /@ Split@#] == 1 &]; p[n_] := p[n] = Select[d[n], Count[#, ?OddQ] == -1 + Count[#, ?EvenQ] &]; t = Table[p[n], {n, 0, 20}]
TableForm[t] (* shows the partitions *)
u = Table[Length[p[2 n + 1]], {n, 0, 38}] (* A239873 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n > i (i + 1)/2 || Abs[t] > n, 0, If[n == 0, 1, b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t + (2 Mod[i, 2] - 1)]]]]; a[n_] := b[2n+1, 2n+1, 1]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)
A366748
Numbers k such that (sum of odd prime indices of k) = (sum of even prime indices of k).
Original entry on oeis.org
1, 12, 70, 90, 112, 144, 286, 325, 462, 520, 525, 594, 646, 675, 832, 840, 1045, 1080, 1326, 1334, 1344, 1666, 1672, 1728, 1900, 2142, 2145, 2294, 2465, 2622, 2695, 2754, 3040, 3432, 3465, 3509, 3526, 3900, 3944, 4186, 4255, 4312, 4455, 4845, 4864, 4900, 4982
Offset: 1
The terms together with their prime indices begin:
1: {}
12: {1,1,2}
70: {1,3,4}
90: {1,2,2,3}
112: {1,1,1,1,4}
144: {1,1,1,1,2,2}
286: {1,5,6}
325: {3,3,6}
462: {1,2,4,5}
520: {1,1,1,3,6}
525: {2,3,3,4}
594: {1,2,2,2,5}
646: {1,7,8}
675: {2,2,2,3,3}
832: {1,1,1,1,1,1,6}
840: {1,1,1,2,3,4}
For example, 525 has prime indices {2,3,3,4}, and 3+3 = 2+4, so 525 is in the sequence.
For prime factors instead of indices we have
A019507.
Partitions of this type are counted by
A239261.
These are the positions of zeros in
A366749.
-
prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n], {p_,k_}:>Table[PrimePi[p],{k}]]]];
Select[Range[1000], Total[Select[prix[#],OddQ]]==Total[Select[prix[#],EvenQ]]&]
A255001
Number of partitions of 4n into distinct parts with equal sums of odd and even parts.
Original entry on oeis.org
1, 0, 1, 2, 4, 6, 12, 15, 30, 40, 70, 96, 165, 216, 352, 486, 736, 988, 1518, 1998, 2944, 3952, 5607, 7488, 10614, 13916, 19305, 25536, 34854, 45568, 61864, 80240, 107640, 139776, 184832, 238680, 314628, 402800, 526176, 673652, 872592, 1110060, 1431704
Offset: 0
a(0) = 1: [], the empty partition.
a(1) = 0.
a(2) = 1: [4,3,1].
a(3) = 2: [6,5,1], [5,4,2,1].
a(4) = 4: [8,7,1], [8,5,3], [7,6,2,1], [6,5,3,2].
-
g:= proc(n, i) option remember; `if`(i*(i+1)/2n, 0, g(n-i, i-1))))
end:
b:= proc(n, i) option remember; `if`(n=0, 1,
`if`(i<1, 0, b(n, i-2)+`if`(i>n, 0, b(n-i, i-2))))
end:
a:= n-> g(n$2)*b(2*n, 2*n-1):
seq(a(n), n=0..50);
-
g[n_, i_] := g[n, i] = If[i(i+1)/2 < n, 0, If[n == 0, 1, g[n, i - 1] + If[i > n, 0, g[n - i, i - 1]]]];
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i - 2] + If[i > n, 0, b[n - i, i - 2]]]];
a[n_] := g[n, n] b[2n, 2n-1];
a /@ Range[0, 50] (* Jean-François Alcover, Dec 11 2020, after Alois P. Heinz *)
A355321
Numbers k such that the k-th composition in standard order has the same number of even parts as odd.
Original entry on oeis.org
0, 5, 6, 17, 18, 20, 24, 43, 45, 46, 53, 54, 58, 65, 66, 68, 72, 80, 96, 139, 141, 142, 149, 150, 154, 163, 165, 166, 169, 172, 177, 178, 180, 184, 197, 198, 202, 209, 210, 212, 216, 226, 232, 257, 258, 260, 264, 272, 288, 320, 343, 347, 349, 350, 363, 365
Offset: 1
The terms together with their corresponding compositions begin:
0: ()
5: (2,1)
6: (1,2)
17: (4,1)
18: (3,2)
20: (2,3)
24: (1,4)
43: (2,2,1,1)
45: (2,1,2,1)
46: (2,1,1,2)
53: (1,2,2,1)
54: (1,2,1,2)
58: (1,1,2,2)
65: (6,1)
66: (5,2)
68: (4,3)
72: (3,4)
80: (2,5)
96: (1,6)
These compositions are counted by
A098123, without multiplicity
A242821.
For partitions without multiplicity we have
A325700, counted by
A241638.
-
stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
Select[Range[0,100],Count[stc[#],?EvenQ]==Count[stc[#],?OddQ]&]
Comments