A350940 Maximal permanent of an n X n Toeplitz matrix using the first 2*n - 1 prime numbers.
1, 2, 31, 2364, 346018, 82285908, 39135296624
Offset: 0
Examples
a(2) = 31: 5 2 3 5 a(3) = 2364: 11 5 3 7 11 5 2 7 11
Links
- Lucas A. Brown, A350939+40.sage
- Wikipedia, Toeplitz Matrix
Programs
-
Mathematica
a[n_] := Max[Table[Permanent[HankelMatrix[Join[Drop[per = Part[Permutations[Prime[Range[2 n - 1]]], i], n], {Part[per, n]}], Join[{Part[per, n]}, Drop[per, - n]]]], {i, (2 n - 1) !}]]; Join[{1}, Array[a, 5]] (* Stefano Spezia, Feb 06 2024 *)
-
PARI
a(n) = my(v=[1..2*n-1], m=-oo, d); forperm(v, p, d = matpermanent(matrix(n, n, i, j, prime(p[i+j-1]))); if (d>m, m = d)); m; \\ Michel Marcus, Feb 08 2024
-
Python
from itertools import permutations from sympy import Matrix, prime def A350940(n): return 1 if n == 0 else max(Matrix([p[n-1-i:2*n-1-i] for i in range(n)]).per() for p in permutations(prime(i) for i in range(1,2*n))) # Chai Wah Wu, Jan 27 2022
Extensions
a(5) from Alois P. Heinz, Jan 26 2022
a(6) from Lucas A. Brown, Sep 05 2022
Comments