%I #17 Oct 15 2024 15:01:34
%S 2,5,39,364,4284,57882,888365,15120105,281941490,5698630860,
%T 123850391756,2875187314622,70909556459276,1849319825544900,
%U 50801676936624147,1464954360561398340,44213852151883887000,1392971702129279452950,45705100441642892335954,1558551328538087579977710
%N Number of equational laws for magmas involving n operations, up to relabeling and symmetry, after removing nontrivial reflexive laws.
%H Chai Wah Wu, <a href="/A376640/b376640.txt">Table of n, a(n) for n = 0..444</a>
%H Equational Theories project, <a href="https://teorth.github.io/equational_theories/blueprint/sect0001.html">Basic theory of magmas</a>.
%H Equational Theories project, <a href="https://github.com/teorth/equational_theories/blob/main/scripts/generate_eqs_list.py">Generating a list of equations on magmas</a>, Python script.
%H Terence Tao, <a href="https://terrytao.wordpress.com/2024/09/25/a-pilot-project-in-universal-algebra-to-explore-new-ways-to-collaborate-and-use-machine-assistance/">A pilot project in universal algebra to explore new ways to collaborate and use machine assistance?</a>, 25 Sep 2024.
%F For odd n, a(n) = A376620(n) = A289679(n+2)/2.
%F For n=0, a(0) = 2.
%F For even n >= 2, a(n) = A376620(n) - A289679(n/2+1).
%e For n=0 the distinct laws are x=x and x=y.
%e For n=1 the distinct laws are x=x*x, x=x*y, x=y*x, x=y*y, and x=y*z.
%e 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).
%o (Python)
%o from functools import lru_cache
%o from sympy.functions.combinatorial.numbers import stirling, bell, catalan
%o def A376640(n):
%o if n&1:
%o return catalan(n+1)*bell(n+2)>>1
%o else:
%o if not n: return 2
%o @lru_cache(maxsize=None)
%o 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)
%o 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
%Y Slightly smaller than A376620(n).
%Y Cf. A289679.
%K nonn
%O 0,1
%A _Terence Tao_, Sep 30 2024
%E a(7) and beyond from _Michael S. Branicky_, Sep 30 2024