// For each n, compute the full character table of S_n (Murnaghan-Nakayama via beta-sets) // and find which rows have the most negative entries. Columns = conjugacy classes (each counted once). function partitions(n, max = n) { if (n === 0) return [[]]; const r = []; for (let k = Math.min(n, max); k >= 1; k--) for (const p of partitions(n - k, k)) r.push([k, ...p]); return r; } function chi(lam, mu) { // chi^lam(mu), MN rule on beta-set const L = lam.length; const beta = lam.map((x, i) => x + (L - 1 - i)); // distinct, decreasing const memo = new Map(); function rec(bset, j) { // bset: sorted desc array of beads; j: index of next part of mu if (j === mu.length) return 1; const key = bset.join(",") + "|" + j; if (memo.has(key)) return memo.get(key); const k = mu[j], S = new Set(bset); let tot = 0; for (const b of bset) { const nb = b - k; if (nb < 0 || S.has(nb)) continue; let between = 0; for (const c of bset) if (c > nb && c < b) between++; const nbset = bset.map(c => c === b ? nb : c).sort((x, y) => y - x); tot += (between % 2 ? -1 : 1) * rec(nbset, j + 1); } memo.set(key, tot); return tot; } return rec(beta, 0); } const Nmax = +process.argv[2] || 16; for (let n = 2; n <= Nmax; n++) { const P = partitions(n); const signKey = Array(n).fill(1).join(","); let best = -1, bestRows = [], signNeg = 0; for (const lam of P) { let neg = 0; for (const mu of P) if (chi(lam, mu) < 0) neg++; const k = lam.join(","); if (k === signKey) signNeg = neg; if (neg > best) { best = neg; bestRows = [k]; } else if (neg === best) bestRows.push(k); } const signUnique = bestRows.length === 1 && bestRows[0] === signKey; console.log(`n=${n} p(n)=${P.length} sign-row negatives=${signNeg} max=${best} maximizers=${bestRows.length <= 4 ? bestRows.map(r=>"("+r+")").join(" ") : bestRows.length + " rows"} ${signUnique ? "SIGN UNIQUE MAX" : (bestRows.includes(signKey) ? "sign tied" : "SIGN NOT MAX")}`); }