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 A365676 #37 Mar 28 2025 02:10:45 %S A365676 1,0,1,0,2,0,0,2,1,0,0,3,2,0,0,0,2,5,0,0,0,0,4,6,1,0,0,0,0,2,11,2,0,0, %T A365676 0,0,0,4,13,5,0,0,0,0,0,0,3,17,10,0,0,0,0,0,0,0,4,22,15,1,0,0,0,0,0,0, %U A365676 0,2,27,25,2,0,0,0,0,0,0,0,0,6,29,37,5,0,0,0,0,0,0,0,0 %N A365676 Triangle read by rows: T(n, k) is the number of partitions of n having exactly k distinct part sizes, for 0 <= k <= n. %H A365676 P. A. MacMahon, <a href="https://doi.org/10.1112/plms/s2-19.1.75">Divisors of numbers and their continuations in the theory of partitions</a>, Proc. London Math. Soc., (2) 19 (1919), 75-113; Coll. Papers II, pp. 303-341. %F A365676 T(n, k) = [t^k][x^n] Product_{j>=1} (1 + t*x^j / (1 - x^j)). %F A365676 T(n, k) = 0 for n>0 and k=0. T(n,k) = 0 for k > floor([sqrt(1+8n)-1]/2). - _Chai Wah Wu_, Sep 15 2023 %e A365676 Triangle T(n, k) starts: %e A365676 [0] 1; %e A365676 [1] 0, 1; %e A365676 [2] 0, 2, 0; %e A365676 [3] 0, 2, 1, 0; %e A365676 [4] 0, 3, 2, 0, 0; %e A365676 [5] 0, 2, 5, 0, 0, 0; %e A365676 [6] 0, 4, 6, 1, 0, 0, 0; %e A365676 [7] 0, 2, 11, 2, 0, 0, 0, 0; %e A365676 [8] 0, 4, 13, 5, 0, 0, 0, 0, 0; %e A365676 [9] 0, 3, 17, 10, 0, 0, 0, 0, 0, 0; %p A365676 P := proc(n, k, r) option remember; local j; # after Amir Livne Bar-on %p A365676 if n = 0 then return ifelse(k = 0, 1, 0) fi; %p A365676 if k = 0 or r = 0 then return 0 fi; %p A365676 add(P(n - r * j, k - 1, r - 1), j = 1..iquo(n, r)) + P(n, k, r - 1) end: %p A365676 A365676row := n -> local k; seq(P(n, k, n), k = 0..n): %p A365676 seq(print(A365676row(n)), n = 0..9); %p A365676 # Using the generating function: %p A365676 p := product(1 + t*x^j/(1 - x^j), j = 1..20): %p A365676 ser := series(p, x, 20): %p A365676 seq(seq(coeff(coeff(ser, x, n), t, k), k = 0..n), n = 0..9); %t A365676 P[n_, k_, r_] := P[n, k, r] = Which[n == 0, If[k == 0, 1, 0], k == 0 || r == 0, 0, True, Sum[P[n-r*j, k-1, r-1], {j, 1, Quotient[n, r]}]+P[n, k, r-1]]; A365676row[n_] := Table[P[n, k, n], {k, 0, n}]; Table[A365676row[n], {n, 0, 12}] // Flatten (* _Jean-François Alcover_, Oct 21 2023, from 1st Maple program *) %o A365676 (Python) # after Amir Livne Bar-on %o A365676 from functools import cache %o A365676 @cache %o A365676 def P(n: int, k: int, r: int) -> int: %o A365676 if n == 0: return 1 if k == 0 else 0 %o A365676 if k == 0 or r == 0: return 0 %o A365676 return sum(P(n - r * j, k - 1, r - 1) %o A365676 for j in range(1, n // r + 1)) + P(n, k, r - 1) %o A365676 def A365676Row(n) -> list[int]: %o A365676 return [P(n, k, n) for k in range(n + 1)] %o A365676 for n in range(10): print(A365676Row(n)) %o A365676 (PARI) T(n,k) = my(nb=0); forpart(p=n, if (#Set(p) == k, nb++)); nb; \\ _Michel Marcus_, Sep 17 2023 %Y A365676 Variants: A116608 (nonzero terms), A060177. %Y A365676 Cf. A000041 (row sums), A000005 (T(n,1)), A002133 (T(n,2)), A002134 (T(n,3)), A365630 (T(n,4)), A365631 (T(n,5)). %K A365676 nonn,tabl %O A365676 0,5 %A A365676 _Peter Luschny_, Sep 15 2023