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.

A238395 Number of partitions of n that sorted in increasing order contain a part k in position k for some k.

This page as a plain text file.
%I A238395 #22 Oct 27 2023 20:50:48
%S A238395 0,1,1,2,4,5,8,12,18,25,34,47,65,88,118,154,203,263,343,442,568,721,
%T A238395 914,1149,1445,1807,2255,2800,3468,4270,5250,6425,7855,9566,11635,
%U A238395 14103,17068,20584,24784,29754,35670,42653,50934,60688,72212,85742,101662,120293
%N A238395 Number of partitions of n that sorted in increasing order contain a part k in position k for some k.
%C A238395 Note that considering partitions in standard decreasing order, we obtain A001522.
%H A238395 Alois P. Heinz, <a href="/A238395/b238395.txt">Table of n, a(n) for n = 0..1000</a> (first 201 terms from Giovanni Resta)
%F A238395 a(n) + A238394(n) = p(n) = A000041(n).
%e A238395 a(6) = 11 - 3 = 8, because of the 11 partitions of 6 only 3 do not contain a 1 in position 1, a 2 in position 2, or a 3 in position 3, namely (3,3), (2,4) and (6).
%p A238395 b:= proc(n, i) option remember; `if`(n=0, [0, 1],
%p A238395       `if`(i<1, [0$2], b(n, i-1) +`if`(i>n, 0,
%p A238395       (p->[p[1] +coeff(p[2], x, i-1), expand(x*(p[2]-
%p A238395        coeff(p[2], x, i-1)*x^(i-1)))])(b(n-i, i)))))
%p A238395     end:
%p A238395 a:= n-> b(n$2)[1]:
%p A238395 seq(a(n), n=0..70);  # _Alois P. Heinz_, Feb 26 2014
%t A238395 a[n_] := Length@ Select[IntegerPartitions@ n, MemberQ[ Reverse@# - Range@ Length@#, 0] &]; Array[a, 30]
%t A238395 (* Second program: *)
%t A238395 b[n_, i_] := b[n, i] = If[n==0, {0, 1}, If[i<1, {0, 0}, b[n, i-1] + If[i>n, 0, Function[p, {p[[1]] + Coefficient[p[[2]], x, i-1], x*(p[[2]] - Coefficient[p[[2]], x, i-1]*x^(i-1))}][b[n-i, i]]]]]; a[n_] := b[n, n][[1]]; Table[a[n], {n, 0, 70}] (* _Jean-François Alcover_, Aug 29 2016, after _Alois P. Heinz_ *)
%Y A238395 Cf. A000041, A238394, A064428, A001522.
%K A238395 nonn
%O A238395 0,4
%A A238395 _Giovanni Resta_, Feb 26 2014