cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A350940 Maximal permanent of an n X n Toeplitz matrix using the first 2*n - 1 prime numbers.

This page as a plain text file.
%I A350940 #28 Feb 12 2024 10:12:57
%S A350940 1,2,31,2364,346018,82285908,39135296624
%N A350940 Maximal permanent of an n X n Toeplitz matrix using the first 2*n - 1 prime numbers.
%C A350940 For n X n Hankel matrices the same maximal permanents appear.
%H A350940 Lucas A. Brown, <a href="https://github.com/lucasaugustus/oeis/blob/main/A350939%2B40.sage">A350939+40.sage</a>
%H A350940 Wikipedia, <a href="http://en.wikipedia.org/wiki/Toeplitz_matrix">Toeplitz Matrix</a>
%e A350940 a(2) = 31:
%e A350940     5    2
%e A350940     3    5
%e A350940 a(3) = 2364:
%e A350940    11    5    3
%e A350940     7   11    5
%e A350940     2    7   11
%t A350940 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 *)
%o A350940 (Python)
%o A350940 from itertools import permutations
%o A350940 from sympy import Matrix, prime
%o A350940 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
%o A350940 (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
%Y A350940 Cf. A318173, A350933, A350939 (minimal), A290302, A350938, A369952.
%K A350940 nonn,hard,more
%O A350940 0,2
%A A350940 _Stefano Spezia_, Jan 26 2022
%E A350940 a(5) from _Alois P. Heinz_, Jan 26 2022
%E A350940 a(6) from _Lucas A. Brown_, Sep 05 2022