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.

Original entry on oeis.org

1, 1, 2, 4, 8, 17, 40, 105, 304, 958, 3255, 11851, 46096, 191648, 854551, 4101826, 21213282, 117747119, 695773801, 4332490151, 28149712546, 189300600481, 1309755334070, 9286984108299, 67327505784439, 498502290046850, 3769028024302567, 29115361551715499
Offset: 0

Views

Author

Alois P. Heinz, Feb 10 2020

Keywords

Examples

			a(2) = 2: 12, 1|2.
a(3) = 4: 123, 12|3, 13|2, 1|2|3.
a(4) = 8: 1234, 123|4, 124|3, 12|3|4, 134|2, 13|2|4, 14|2|3, 1|2|3|4.
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.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, 1, add(`if`(j<=m
           and isprime(j), 0, b(n-1, max(j, m))), j=1..m+1))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..32);
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, i+1)*
           binomial(n-1, j-1), j=1..`if`(isprime(i+1), 1, n)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..32);
  • Mathematica
    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]}]];
    a[n_] := b[n, 0];
    a /@ Range[0, 32] (* Jean-François Alcover, May 07 2020, after 2nd Maple program *)