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.

Showing 1-4 of 4 results.

A275313 Number of set partitions of [n] where adjacent blocks differ in size.

Original entry on oeis.org

1, 1, 1, 4, 7, 23, 100, 333, 1443, 6910, 36035, 186958, 1095251, 6620976, 42151463, 290483173, 2030271491, 15044953241, 116044969497, 930056879535, 7749440529803, 66931578540965, 597728811956244, 5511695171795434, 52578231393128128, 515775207055816041
Offset: 0

Views

Author

Alois P. Heinz, Jul 22 2016

Keywords

Examples

			a(3) = 4: 123, 12|3, 13|2, 1|23.
a(4) = 7: 1234, 123|4, 124|3, 134|2, 1|234, 1|23|4, 1|24|3.
a(5) = 23: 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, 1|234|5, 1|235|4, 14|2|35, 1|245|3, 15|2|34.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(`if`(i=j, 0,
          b(n-j, `if`(j>n-j, 0, j))*binomial(n-1, j-1)), j=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..35);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n==0, 1, Sum[If[i==j, 0, b[n-j, If[j>n-j, 0, j]]* Binomial[n-1, j-1]], {j, 1, n}]]; a[n_] := b[n, 0]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Dec 18 2016, after Alois P. Heinz *)

A286076 Number of permutations of [n] with alternating cycle size parities.

Original entry on oeis.org

1, 1, 1, 5, 8, 78, 206, 2722, 10516, 169544, 883580, 16569420, 110272040, 2339828920, 19127099680, 450962267600, 4399562960000, 113769961266000, 1295735797694000, 36390357922438000, 475484093140888000, 14390912055770276000, 212715123602601932000
Offset: 0

Views

Author

Alois P. Heinz, May 01 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Examples

			a(3) = 5: (123), (132), (12)(3), (13)(2), (1)(23).
a(4) = 8: (1234), (1243), (1324), (1342), (1423), (1432), (1)(23)(4), (1)(24)(3).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1, add(`if`((i+t)::odd,
          b(n-i, 1-t)*(i-1)!*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..30);
  • Mathematica
    b[n_, t_] := b[n, t] = If[n == 0, 1, Sum[If[(i + t) // OddQ, b[n - i, 1 - t]*(i - 1)!*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, 30}] (* Jean-François Alcover, May 28 2018, from Maple *)

A361804 Number of partitions of [n] with an equal number of even and odd block sizes.

Original entry on oeis.org

1, 0, 0, 3, 0, 15, 45, 63, 1260, 1515, 25515, 104973, 510345, 5679765, 17252235, 263214318, 1207222380, 11863296915, 101718989235, 630468648873, 8281982665215, 48583038314415, 656006633919945, 5122900223419938, 54304561161840825, 605082149235374265
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2023

Keywords

Comments

Half the number of block sizes are even and the other half are odd.

Examples

			a(0) = 1: () the empty partition.
a(1) = 0.
a(2) = 0.
a(3) = 3: 12|3, 13|2, 1|23.
a(4) = 0.
a(5) = 15: 1234|5, 1235|4, 123|45, 1245|3, 124|35, 125|34, 12|345, 1345|2, 134|25, 135|24, 13|245, 145|23, 14|235, 15|234, 1|2345.
a(6) = 45: 12|34|5|6, 12|35|4|6, 12|3|45|6, 12|36|4|5, 12|3|46|5, 12|3|4|56, 13|24|5|6, 13|25|4|6, 13|2|45|6, 13|26|4|5, 13|2|46|5, 13|2|4|56, 14|23|5|6, 15|23|4|6, 1|23|45|6, 16|23|4|5, 1|23|46|5, 1|23|4|56, 14|25|3|6, 14|2|35|6, 14|26|3|5, 14|2|36|5, 14|2|3|56, 15|24|3|6, 1|24|35|6, 16|24|3|5, 1|24|36|5, 1|24|3|56, 15|2|34|6, 1|25|34|6, 16|2|34|5, 1|26|34|5, 1|2|34|56, 15|26|3|4, 15|2|36|4, 15|2|3|46, 16|25|3|4, 1|25|36|4, 1|25|3|46, 16|2|35|4, 1|26|35|4, 1|2|35|46, 16|2|3|45, 1|26|3|45, 1|2|36|45.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, x, y) option remember; `if`(abs(x-y)>2*n, 0,
         `if`(n=0, 1, b(n-1, x+1, y)+`if`(x>0, b(n-1, x-1, y+1)*x, 0)+
         `if`(y>0, b(n-1, x+1, y-1)*y, 0)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..33);

Formula

a(n) mod 5 = 3 for n in { A004767 }, a(n) mod 5 = 1 for n = 0 and a(n) mod 5 = 0 for all other n (n in { A004773 } \ { 0 }).
a(n) mod 3 = 0 for n >= 1.

A363073 Number of set partitions of [n] such that each element is contained in a block whose block size parity coincides with the parity of the element.

Original entry on oeis.org

1, 1, 0, 0, 1, 2, 0, 0, 20, 48, 0, 0, 1147, 3968, 0, 0, 173203, 709488, 0, 0, 53555964, 246505600, 0, 0, 28368601065, 148963383616, 0, 0, 24044155851601, 141410718244864, 0, 0, 30934515698084780, 198914201874983936, 0, 0, 57215369885233295955, 398742900995358584320
Offset: 0

Views

Author

Alois P. Heinz, May 17 2023

Keywords

Comments

All odd elements are in blocks with an odd block size and all even elements are in blocks with an even block size.

Examples

			a(0) = 1: (), the empty partition.
a(1) = 1: 1.
a(4) = 1: 1|24|3.
a(5) = 2: 135|24, 1|24|3|5.
a(8) = 20: 135|2468|7, 135|24|68|7, 137|2468|5, 137|24|5|68, 135|26|48|7, 135|28|46|7, 137|26|48|5, 137|28|46|5, 157|2468|3, 157|24|3|68, 1|2468|357, 1|24|357|68, 1|2468|3|5|7, 1|24|3|5|68|7, 157|26|3|48, 157|28|3|46, 1|26|357|48, 1|28|357|46, 1|26|3|48|5|7, 1|28|3|46|5|7.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1, add(
         `if`((j+t)::even, b(n-j, t)*binomial(n-1, j-1), 0), j=1..n))
        end:
    a:= n-> (h-> b(n-h, 1)*b(h, 0))(iquo(n, 2)):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, t_] := b[n, t] = If[n == 0, 1, Sum[If[EvenQ[j + t], b[n - j, t]* Binomial[n - 1, j - 1], 0], {j, 1, n}]];
    a[n_] := b[n - #, 1]*b[#, 0]&[Quotient[n, 2]];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Nov 18 2023, after Alois P. Heinz *)

Formula

a(n) = A003724(ceiling(n/2)) * A005046(floor(n/4)) if (n mod 4) in {0,1}.
a(n) = 0 if (n mod 4) in {2,3}.
Showing 1-4 of 4 results.