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.

A332398 Number of set partitions of [n] where all prime-indexed blocks are singletons.

This page as a plain text file.
%I A332398 #14 May 07 2020 07:11:21
%S A332398 1,1,2,4,8,17,40,105,304,958,3255,11851,46096,191648,854551,4101826,
%T A332398 21213282,117747119,695773801,4332490151,28149712546,189300600481,
%U A332398 1309755334070,9286984108299,67327505784439,498502290046850,3769028024302567,29115361551715499
%N A332398 Number of set partitions of [n] where all prime-indexed blocks are singletons.
%H A332398 Alois P. Heinz, <a href="/A332398/b332398.txt">Table of n, a(n) for n = 0..605</a>
%H A332398 Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>
%e A332398 a(2) = 2: 12, 1|2.
%e A332398 a(3) = 4: 123, 12|3, 13|2, 1|2|3.
%e A332398 a(4) = 8: 1234, 123|4, 124|3, 12|3|4, 134|2, 13|2|4, 14|2|3, 1|2|3|4.
%e A332398 a(5) = 17: 12345, 1234|5, 1235|4, 123|4|5, 1245|3, 124|3|5, 125|3|4, 12|3|4|5, 1345|2, 134|2|5, 135|2|4, 13|2|4|5, 145|2|3, 14|2|3|5, 15|2|3|4, 1|2|3|45, 1|2|3|4|5.
%p A332398 b:= proc(n, m) option remember; `if`(n=0, 1, add(`if`(j<=m
%p A332398        and isprime(j), 0, b(n-1, max(j, m))), j=1..m+1))
%p A332398     end:
%p A332398 a:= n-> b(n, 0):
%p A332398 seq(a(n), n=0..32);
%p A332398 # second Maple program:
%p A332398 b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, i+1)*
%p A332398        binomial(n-1, j-1), j=1..`if`(isprime(i+1), 1, n)))
%p A332398     end:
%p A332398 a:= n-> b(n, 0):
%p A332398 seq(a(n), n=0..32);
%t A332398 b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n-j, i+1] Binomial[n-1, j-1], {j, 1, If[PrimeQ[i+1], 1, n]}]];
%t A332398 a[n_] := b[n, 0];
%t A332398 a /@ Range[0, 32] (* _Jean-François Alcover_, May 07 2020, after 2nd Maple program *)
%Y A332398 Cf. A000040, A000110, A007476, A332248.
%K A332398 nonn
%O A332398 0,3
%A A332398 _Alois P. Heinz_, Feb 10 2020