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.
%I A277579 #24 Aug 01 2021 16:40:44 %S A277579 1,0,1,1,1,2,3,3,4,6,7,9,13,15,19,25,31,38,48,59,74,90,111,136,166, %T A277579 201,246,297,357,431,522,621,745,892,1063,1263,1503,1780,2109,2491, %U A277579 2941,3463,4077,4783,5616,6576,7689,8981,10486,12207,14209,16516,19178,22231 %N A277579 Number of partitions of n for which the number of even parts is equal to the positive alternating sum of the parts. %C A277579 In the first Maple program (improvable) AS gives the positive alternating sum of a finite sequence s, EP gives the number of even terms of a finite sequence of positive integers. %C A277579 For the specified value of n, the second Maple program lists the partitions of n counted by a(n). %C A277579 Also the number of integer partitions of n with as many even parts as odd parts in the conjugate partition. - _Gus Wiseman_, Jul 26 2021 %H A277579 Alois P. Heinz, <a href="/A277579/b277579.txt">Table of n, a(n) for n = 0..1000</a> %e A277579 a(9) = 6: [2,1,1,1,1,1,1,1], [3,2,1,1,1,1], [3,3,2,1], [4,2,2,1], [4,3,1,1], [5,4]. %e A277579 a(10) = 7: [1,1,1,1,1,1,1,1,1,1], [3,2,2,1,1,1], [3,3,1,1,1,1], [4,2,1,1,1,1], [4,3,2,1], [5,5], [6,4]. %e A277579 a(11) = 9: [2,1,1,1,1,1,1,1,1,1], [3,2,1,1,1,1,1,1], [3,3,2,1,1,1], [3,3,3,2], [4,2,2,1,1,1], [4,3,1,1,1,1], [5,2,2,2], [5,4,1,1], [6,5]. %p A277579 with(combinat): AS := proc (s) options operator, arrow: abs(add((-1)^(i-1)*s[i], i = 1 .. nops(s))) end proc: EP := proc (s) local ct, j: ct := 0: for j to nops(s) do if `mod`(s[j], 2) = 0 then ct := ct+1 else end if end do: ct end proc: a := proc (n) local P, c, k: P := partition(n): c := 0: for k to nops(P) do if AS(P[k]) = EP(P[k]) then c := c+1 else end if end do: c end proc: seq(a(n), n = 0 .. 30); %p A277579 n := 8: with(combinat): AS := proc (s) options operator, arrow: abs(add((-1)^(i-1)*s[i], i = 1 .. nops(s))) end proc: EP := proc (s) local ct, j: ct := 0: for j to nops(s) do if `mod`(s[j], 2) = 0 then ct := ct+1 else end if end do: ct end proc: P := partition(n): C := {}: for k to nops(P) do if AS(P[k]) = EP(P[k]) then C := `union`(C, {P[k]}) else end if end do: C; %p A277579 # alternative Maple program: %p A277579 b:= proc(n, i, s, t) option remember; `if`(n=0, %p A277579 `if`(s=0, 1, 0), `if`(i<1, 0, b(n, i-1, s, t)+ %p A277579 `if`(i>n, 0, b(n-i, i, s+t*i-irem(i+1, 2), -t)))) %p A277579 end: %p A277579 a:= n-> b(n$2, 0, 1): %p A277579 seq(a(n), n=0..60); %t A277579 b[n_, i_, s_, t_] := b[n, i, s, t] = If[n == 0, If[s == 0, 1, 0], If[i<1, 0, b[n, i-1, s, t] + If[i>n, 0, b[n-i, i, s + t*i - Mod[i+1, 2], -t]]]]; a[n_] := b[n, n, 0, 1]; Table[a[n], {n, 0, 60}] (* _Jean-François Alcover_, Dec 21 2016, translated from Maple *) %t A277579 conj[y_]:=If[Length[y]==0,y,Table[Length[Select[y,#>=k&]],{k,1,Max[y]}]]; Table[Length[Select[IntegerPartitions[n],Count[#,_?EvenQ]==Count[conj[#],_?OddQ]&]],{n,0,15}] (* _Gus Wiseman_, Jul 26 2021 *) %o A277579 (Sage) %o A277579 def a(n): %o A277579 AS = lambda s: abs(sum((-1)^i*t for i,t in enumerate(s))) %o A277579 EP = lambda s: sum((t+1)%2 for t in s) %o A277579 return sum(AS(p) == EP(p) for p in Partitions(n)) %o A277579 print([a(n) for n in (0..30)]) # _Peter Luschny_, Oct 21 2016 %Y A277579 The sign-sensitive version is A035457 (aerated version of A000009). %Y A277579 Comparing odd parts to odd conjugate parts gives A277103. %Y A277579 Comparing product of parts to product of conjugate parts gives A325039. %Y A277579 Comparing the rev-alt sum to that of the conjugate gives A345196. %Y A277579 A000041 counts partitions of 2n with alternating sum 0, ranked by A000290. %Y A277579 A103919 counts partitions by sum and alternating sum (reverse: A344612). %Y A277579 A120452 counts partitions of 2n with rev-alt sum 2 (negative: A344741). %Y A277579 A124754 gives alternating sums of standard compositions (reverse: A344618). %Y A277579 A316524 is the alternating sum of the prime indices of n (reverse: A344616). %Y A277579 A344610 counts partitions by sum and positive reverse-alternating sum. %Y A277579 A344611 counts partitions of 2n with reverse-alternating sum >= 0. %Y A277579 Cf. A000070, A000097, A000700, A006330, A027187, A027193, A236559, A257991, A325534, A325535, A344607, A344651. %K A277579 nonn %O A277579 0,6 %A A277579 _Emeric Deutsch_ and _Alois P. Heinz_, Oct 20 2016