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 A330661 #36 Apr 29 2020 07:36:53 %S A330661 1,1,2,1,2,3,1,3,4,5,1,3,5,6,7,1,5,8,9,10,11,1,5,9,12,13,14,15,1,8,13, %T A330661 18,19,20,21,22,1,8,19,22,26,27,28,29,30,1,13,22,30,37,38,39,40,41,42, %U A330661 1,13,30,41,46,51,52,53,54,55,56,1,20,44,59,62,71,72,73,74,75,76,77 %N A330661 T(n,k) is the index within the partitions of n in canonical ordering of the k-th partition whose parts differ pairwise by at most one. %C A330661 For each length k in [1..n] there is exactly one such partition [p_1,...,p_k], with p_i = a+1 for i=1..j and p_i = a for i=j+1..k, where a = floor(n/k) and j = n - k * a. %C A330661 If k | n, then all parts p_i are equal. A027750 lists the indices of these partitions in this triangle. %C A330661 Canonical ordering is also known as graded reverse lexicographic ordering, see A080577 or link below. %H A330661 Alois P. Heinz, <a href="/A330661/b330661.txt">Rows n = 1..200, flattened</a> %H A330661 OEIS Wiki, <a href="http://oeis.org/wiki/Orderings of partitions#A_comparison">Orderings of partitions (a comparison)</a>. %F A330661 T(n,1) = 1. %F A330661 T(n,n) = A000041(n). %F A330661 T(n,k) = A000041(n) - (n - k) for k = ceiling(n/2)..n. %F A330661 T(2n,2) = T(2n+1,2) = A216053(n). - _Alois P. Heinz_, Jan 28 2020 %e A330661 Partitions of 8 in canonical ordering begin: 8, 71, 62, 611, 53, 521, 5111, 44, 431, 422, 4211, 41111, 332, ... . The partitions whose parts differ pairwise by at most one in this list are 8, 44, 332, ... at indices 1, 8, 13, ... and this gives row 8 of this triangle. %e A330661 Triangle T(n,k) begins: %e A330661 1; %e A330661 1, 2; %e A330661 1, 2, 3; %e A330661 1, 3, 4, 5; %e A330661 1, 3, 5, 6, 7; %e A330661 1, 5, 8, 9, 10, 11; %e A330661 1, 5, 9, 12, 13, 14, 15; %e A330661 1, 8, 13, 18, 19, 20, 21, 22; %e A330661 1, 8, 19, 22, 26, 27, 28, 29, 30; %e A330661 1, 13, 22, 30, 37, 38, 39, 40, 41, 42; %e A330661 ... %p A330661 b:= proc(l) option remember; (n-> `if`(n=0, 1, %p A330661 b(subsop(1=[][], l))+g(n, l[1]-1)))(add(j, j=l)) %p A330661 end: %p A330661 g:= proc(n, i) option remember; `if`(n=0 or i=1, 1, %p A330661 `if`(i<1, 0, g(n-i, min(n-i, i))+g(n, i-1))) %p A330661 end: %p A330661 T:= proc(n, k) option remember; 1 + g(n$2)- %p A330661 b((q-> [q+1$r, q$k-r])(iquo(n, k, 'r'))) %p A330661 end: %p A330661 seq(seq(T(n, k), k=1..n), n=1..14); # _Alois P. Heinz_, Feb 19 2020 %t A330661 b[l_List] := b[l] = Function[n, If[n == 0, 1, b[ReplacePart[l, 1 -> Nothing]] + g[n, l[[1]] - 1]]][Total[l]]; %t A330661 g[n_, i_] := g[n, i] = If[n == 0 || i == 1, 1, If[i < 1, 0, g[n - i, Min[n - i, i]] + g[n, i - 1]]]; %t A330661 T[n_, k_] := T[n, k] = Module[{q, r}, {q, r} = QuotientRemainder[n, k]; 1 + g[n, n] - b[Join[Table[q + 1, {r}], Table[q, {k - r}]]]]; %t A330661 Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, Apr 29 2020, after _Alois P. Heinz_ *) %o A330661 (PARI) %o A330661 balP(p) = p[1]-p[#p]<=1 %o A330661 Row(n)={v=vecsort([Vecrev(p) | p<-partitions(n)], , 4);select(i->balP(v[i]),[1..#v])} %o A330661 { for(n=1, 10, print(Row(n))) } %Y A330661 Cf. A000041, A063008, A027750, A080577, A216053, A238639, A238640. %Y A330661 T(2n,n) gives A332706. %K A330661 nonn,tabl %O A330661 1,3 %A A330661 _Peter Dolland_, Dec 23 2019