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-3 of 3 results.

A289680 a(n) = Catalan(n+1)*Bell(n).

Original entry on oeis.org

1, 2, 10, 70, 630, 6864, 87087, 1254110, 20128680, 355185012, 6817706350, 141150702840, 3130281211300, 73933388090280, 1850739337395090, 48898191857790150, 1358695827817964130, 39579468688851814800, 1205409232277565987210, 38286822212810480963940, 1265497066771343361031440
Offset: 0

Views

Author

N. J. A. Sloane, Aug 04 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Array[CatalanNumber[# + 1] BellB[#] &, 21, 0] (* Michael De Vlieger, Aug 04 2017 *)

A376620 Number of equational laws for magmas involving n operations, up to relabeling and symmetry.

Original entry on oeis.org

2, 5, 41, 364, 4294, 57882, 888440, 15120105, 281942218, 5698630860, 123850400282, 2875187314622, 70909556575040, 1849319825544900, 50801676938400207, 1464954360561398340, 44213852151914127210, 1392971702129279452950, 45705100441643456206404, 1558551328538087579977710
Offset: 0

Views

Author

Terence Tao, Sep 30 2024

Keywords

Comments

Is always at least A289679(n+2)/2 (with equality when n is odd), and at most A289679(n+2).
If one does not invoke symmetry, the sequence becomes A289679(n+2).
For a Python script to enumerate the laws (which also deletes trivial laws w=w) see the links.

Examples

			For n=0 the distinct laws are x=x and x=y.
For n=1 the distinct laws are x=x*x, x=x*y, x=y*x, x=y*y, and x=y*z.  (x*y=z, for instance, is a relabeling of x=y*z after applying symmetry.)
		

Crossrefs

Programs

  • PARI
    \\ All functions that are needed
    a110(n) = sum(k=0, n, stirling(n,k,2)); \\ Bell
    a108(n) = binomial(2*n,n)/(n+1); \\ Catalan
    a289679(n) = a108(n-1)*a110(n);
    Ach(n,k)= my(s=n<2 && n>=0 && n==k); if(n<=1, s, k*Ach(n-2,k) + Ach(n-2,k-1) + Ach(n-2,k-2) + s);
    a103293(n) = if(n<3, 1, sum(k=0, n-1, stirling(n-1,k,2) + Ach(n-1,k))/2);
    a376620(n) = if(n%2==0,(a289679(n+2) + a108(n/2) * (2*a103293(n+3) - a110(n+2)))/2, a289679(n+2)/2); \\ Hugo Pfoertner, Sep 30 2024
    
  • Python
    from functools import lru_cache
    from sympy.functions.combinatorial.numbers import stirling, bell, catalan
    def A376620(n):
        if n&1:
            return catalan(n+1)*bell(n+2)>>1
        else:
            @lru_cache(maxsize=None)
            def ach(n,k): return (n==k) if n<2 else k*ach(n-2,k)+ach(n-2,k-1)+ach(n-2,k-2)
            return catalan(n+1)*bell(n+2)+catalan(n>>1)*((sum(stirling(n+2,k,kind=2)+ach(n+2,k)>>1 for k in range(n+3))<<1)-bell(n+2))>>1 # Chai Wah Wu, Oct 15 2024

Formula

For odd n, a(n) = A289679(n+2)/2.
For even n, a(n) = (A289679(n+2) + A000108(n/2) * (2*A103293(n+3) - A000110(n+2)))/2.

Extensions

a(7) and beyond from Michael S. Branicky, Sep 30 2024 using formulas

A376640 Number of equational laws for magmas involving n operations, up to relabeling and symmetry, after removing nontrivial reflexive laws.

Original entry on oeis.org

2, 5, 39, 364, 4284, 57882, 888365, 15120105, 281941490, 5698630860, 123850391756, 2875187314622, 70909556459276, 1849319825544900, 50801676936624147, 1464954360561398340, 44213852151883887000, 1392971702129279452950, 45705100441642892335954, 1558551328538087579977710
Offset: 0

Views

Author

Terence Tao, Sep 30 2024

Keywords

Examples

			For n=0 the distinct laws are x=x and x=y.
For n=1 the distinct laws are x=x*x, x=x*y, x=y*x, x=y*y, and x=y*z.
For n=2 there are 39 distinct laws, including for instance x=(x*y)*x, x*y=y*z, and x*y=y*x, but not x*y=x*y because this is a nontrivial reflexive law (of the form X=X for an expression X that is not just a single indeterminate).
		

Crossrefs

Slightly smaller than A376620(n).
Cf. A289679.

Programs

  • Mathematica
    A376640[0] = 2; A376640[n_?OddQ] := Quotient[CatalanNumber[n + 1] BellB[n + 2], 2];
    A376640[n_?EvenQ /; n > 0] := Module[{m = Quotient[n, 2], bellN2 = BellB[n + 2], h, sum},
    h[ni_, ki_] := h[ni, ki] = If[ni < 2, Boole[ni == ki],
      ki * h[ni - 2, ki] + h[ni - 2, ki - 1] + h[ni - 2, ki - 2]];
    sum = Sum[Quotient[StirlingS2[n + 2, k] + h[n + 2, k], 2], {k, 0, n + 2}];
    Quotient[CatalanNumber[n + 1] bellN2 + CatalanNumber[m] (2 sum - bellN2 - 2 BellB[m + 1]), 2]];
    Table[A376640[n], {n, 0, 19}]  (* after Chai Wah Wu, Peter Luschny, Sep 03 2025 *)
  • Python
    from functools import lru_cache
    from sympy.functions.combinatorial.numbers import stirling, bell, catalan
    def A376640(n):
        if n&1:
            return catalan(n+1)*bell(n+2)>>1
        else:
            if not n: return 2
            @lru_cache(maxsize=None)
            def ach(n,k): return (n==k) if n<2 else k*ach(n-2,k)+ach(n-2,k-1)+ach(n-2,k-2)
            return (catalan(n+1)*bell(n+2)+catalan(m:=n>>1)*((sum(stirling(n+2,k,kind=2)+ach(n+2,k)>>1 for k in range(n+3))<<1)-bell(n+2)-(bell(m+1)<<1))>>1) # Chai Wah Wu, Oct 15 2024

Formula

For odd n, a(n) = A376620(n) = A289679(n+2)/2.
For n=0, a(0) = 2.
For even n >= 2, a(n) = A376620(n) - A289679(n/2+1).

Extensions

a(7) and beyond from Michael S. Branicky, Sep 30 2024
Showing 1-3 of 3 results.