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.

A240138 Number of partitions of n into distinct parts, where the difference between the number of odd parts and the number of even parts is 2.

This page as a plain text file.
%I A240138 #13 Dec 10 2020 17:33:09
%S A240138 1,0,1,0,2,0,2,1,3,2,3,4,4,7,4,11,5,16,6,23,8,31,11,41,16,53,24,67,35,
%T A240138 83,52,102,74,124,106,149,146,179,201,214,268,256,357,307,463,370,599,
%U A240138 447,759,545,959,667,1192,822,1477,1017,1806,1265,2203,1575
%N A240138 Number of partitions of n into distinct parts, where the difference between the number of odd parts and the number of even parts is 2.
%C A240138 With offset 6 number of partitions of n into distinct parts, where the difference between the number of odd parts and the number of even parts is -2.
%H A240138 Alois P. Heinz, <a href="/A240138/b240138.txt">Table of n, a(n) for n = 4..1000</a>
%F A240138 a(n) = [x^n y^2] Product_{i>=1} 1+x^i*y^(2*(i mod 2)-1).
%e A240138 a(16) = 4: [15,1], [13,3], [11,5], [9,7].
%e A240138 a(17) = 7: [11,3,2,1], [9,5,2,1], [9,4,3,1], [8,5,3,1], [7,6,3,1], [7,5,4,1], [7,5,3,2].
%p A240138 b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2 or
%p A240138       abs(t)>n, 0, `if`(n=0, 1, b(n, i-1, t)+
%p A240138       `if`(i>n, 0, b(n-i, i-1, t+(2*irem(i, 2)-1)))))
%p A240138     end:
%p A240138 a:= n-> b(n$2, -2):
%p A240138 seq(a(n), n=4..80);
%t A240138 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]]]];
%t A240138 a[n_] := b[n, n, -2];
%t A240138 a /@ Range[4, 80] (* _Jean-François Alcover_, Dec 10 2020, after _Alois P. Heinz_ *)
%Y A240138 Column k=2 of A240021.
%K A240138 nonn
%O A240138 4,5
%A A240138 _Alois P. Heinz_, Apr 02 2014