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.

A275679 Number of set partitions of [n] with alternating block size parities.

Original entry on oeis.org

1, 1, 1, 4, 3, 20, 43, 136, 711, 1606, 12653, 36852, 250673, 1212498, 6016715, 45081688, 196537387, 1789229594, 8963510621, 76863454428, 512264745473, 3744799424978, 32870550965259, 219159966518160, 2257073412153459, 15778075163815474, 165231652982941085
Offset: 0

Views

Author

Alois P. Heinz, Aug 05 2016

Keywords

Examples

			a(3) = 4: 123, 12|3, 13|2, 1|23.
a(4) = 3: 1234, 1|23|4, 1|24|3.
a(5) = 20: 12345, 1234|5, 1235|4, 123|45, 1245|3, 124|35, 125|34, 12|345, 12|3|45, 1345|2, 134|25, 135|24, 13|245, 13|2|45, 145|23, 14|235, 15|234, 1|2345, 14|2|35, 15|2|34.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1, add(
          `if`((i+t)::odd, b(n-i, 1-t)*binomial(n-1, i-1), 0), i=1..n))
        end:
    a:= n-> `if`(n=0, 1, b(n, 0)+b(n, 1)):
    seq(a(n), n=0..35);
  • Mathematica
    b[n_, t_] := b[n, t] = If[n==0, 1, Sum[If[OddQ[i+t], b[n-i, 1-t] * Binomial[n-1, i-1], 0], {i, 1, n}]]; a[n_] := If[n==0, 1, b[n, 0] + b[n, 1]]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Feb 27 2017, translated from Maple *)