clc
for n=sym(1:31)
a=factorial(n^2-1);
b=factorial(n)^n;
if mod(a,b)>0
fprintf('%d,',n)
end
% disp(' ')
end
finds
2,3,4,5,7,11,13,17,19,23,29,31
Going beyond n=31 goes outside Matlab's factorial capability.
The OEIS identifies the sequence as
A175787, the primes together with 4.
|
Posted by Charlie
on 2024-10-16 18:05:31 |