T(m,n,k) = {
	gcd([
		binomial(n, k),
		binomial(m-n+k, m-n),
		binomial(m-k, n-k)
	]);
}

a(m) = {
	my (v = -oo);
	for (n = 0, m,
		for (k = 0, n,
			v = max(v, T(m, n, k));
		);
	);
	return (v);
}

{
	for (n = 0, 1500,
		print (n " " a(n));
	);
}

quit