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.

Previous Showing 11-18 of 18 results.

A353453 a(n) is the permanent of the n X n symmetric matrix M(n) that is defined as M[i,j] = abs(i - j) if min(i, j) < max(i, j) <= 2*min(i, j), and otherwise 0.

Original entry on oeis.org

1, 0, 1, 0, 1, 4, 64, 576, 7844, 63524, 882772, 11713408, 252996564, 5879980400, 184839020672, 5698866739200, 229815005974352, 9350598794677712, 480306381374466176, 23741710999960266176, 1446802666239931811472, 86153125248221968292928, 6197781268948296566634304
Offset: 0

Views

Author

Stefano Spezia, Apr 19 2022

Keywords

Examples

			a(8) = 7844:
    0,  1,  0,  0,  0,  0,  0,  0;
    1,  0,  1,  2,  0,  0,  0,  0;
    0,  1,  0,  1,  2,  3,  0,  0;
    0,  2,  1,  0,  1,  2,  3,  4;
    0,  0,  2,  1,  0,  1,  2,  3;
    0,  0,  3,  2,  1,  0,  1,  2;
    0,  0,  0,  3,  2,  1,  0,  1;
    0,  0,  0,  4,  3,  2,  1,  0.
		

Crossrefs

Cf. A000982 (number of zero matrix elements), A003983, A006918, A007590 (number of positive matrix elements), A049581, A051125, A173997, A350050, A352967, A353452 (determinant).

Programs

  • Mathematica
    Join[{1},Table[Permanent[Table[If[Min[i,j]
    				
  • PARI
    a(n) = matpermanent(matrix(n, n, i, j, if ((min(i,j) < max(i,j)) && (max(i,j) <= 2*min(i,j)), abs(i-j)))); \\ Michel Marcus, Apr 20 2022
    
  • Python
    from sympy import Matrix
    def A353453(n): return Matrix(n, n, lambda i, j: abs(i-j) if min(i,j)Chai Wah Wu, Aug 29 2023

Formula

Sum_{i=1..n+1-k} M[i,i+k] = A173997(n, k) with 1 <= k <= floor((n + 1)/2).
Sum_{i=1..n} Sum_{j=1..n} M[i,j] = 2*A006918(n-1).
Sum_{i=1..n} Sum_{j=1..n} M[i,j]^2 = A350050(n+1).

A374283 a(n) is the maximal permanent of an n X n symmetric Toeplitz matrix having 0 on the main diagonal and all the integers 1, 2, ..., n-1 off-diagonal.

Original entry on oeis.org

1, 0, 1, 8, 256, 9978, 600052, 49036950, 5286564352, 725724599636
Offset: 0

Views

Author

Stefano Spezia, Jul 02 2024

Keywords

Examples

			a(5) = 9978:
  [0, 4, 3, 2, 1]
  [4, 0, 4, 3, 2]
  [3, 4, 0, 4, 3]
  [2, 3, 4, 0, 4]
  [1, 2, 3, 4, 0]
		

Crossrefs

Cf. A085807 (minimal), A358327.

Programs

  • Mathematica
    a[0]=1; a[n_]:=Max[Table[Permanent[ToeplitzMatrix[Join[{0}, Part[Permutations[Range[n - 1]], i]]]], {i, (n-1)!}]]; Array[a, 11, 0]

A374140 a(n) is the permanent of the symmetric Toeplitz matrix of order n whose element (i,j) equals abs(i-j) or 1 if i = j.

Original entry on oeis.org

1, 1, 2, 11, 117, 2083, 55482, 2063149, 102176977, 6490667261, 514651043730, 49787897503031, 5771746960693493, 789652404867861919, 125885777192807718730, 23129357587464094132601, 4851600400570400272371009, 1152232847579194480216644249, 307579355879152834353840187554
Offset: 0

Views

Author

Stefano Spezia, Jun 28 2024

Keywords

Comments

Conjecture: a(n) is the minimal permanent of an n X n symmetric Toeplitz matrix having 1 on the main diagonal and all the integers 1, 2, ..., n-1 off-diagonal. - Stefano Spezia, Jul 05 2024

Examples

			a(4) = 117:
  [1, 1, 2, 3]
  [1, 1, 1, 2]
  [2, 1, 1, 1]
  [3, 2, 1, 1]
		

Crossrefs

Cf. A085807, A374067, A374139 (determinant).

Programs

  • Mathematica
    a[n_]:=Permanent[Table[If[i == j, 1, Abs[i - j]], {i, n}, {j, n}]]; Join[{1}, Array[a, 18]]
  • PARI
    a(n) = matpermanent(matrix(n, n, i, j, if (i==j, 1, abs(i-j)))); \\ Michel Marcus, Jun 29 2024
    
  • Python
    from sympy import Matrix
    def A374140(n): return Matrix(n,n,[abs(j-k) if j!=k else 1 for j in range(n) for k in range(n)]).per() if n else 1 # Chai Wah Wu, Jul 01 2024

A278857 a(n) = permanent M_n where M_n is the n X n matrix m(i,j) = (i-j)^2.

Original entry on oeis.org

1, 0, 1, 8, 676, 49600, 10335908, 2658757248, 1214367336000, 730771063280640, 642638269862752320, 736176718456263406080, 1122592471007868379259136, 2168016139899273930219233280, 5288852927890824307509101287680, 15889369670472598370104100032512000
Offset: 0

Views

Author

Vaclav Kotesovec, Nov 29 2016

Keywords

Crossrefs

Programs

  • Maple
    with(LinearAlgebra):
    a:= n-> `if`(n=0, 1, Permanent(Matrix(n, (i, j)-> (i-j)^2))):
    seq(a(n), n=0..16);  # Vaclav Kotesovec, Nov 30 2016, after Alois P. Heinz
  • Mathematica
    Flatten[{1, Table[Permanent[Table[(i-j)^2, {i, 1, n}, {j, 1, n}]], {n, 1, 15}]}]
  • PARI
    {a(n) = matpermanent(matrix(n, n, i, j, (i-j)^2))}
    for(n=0, 20, print1(a(n), ", ")) \\ Vaclav Kotesovec, Aug 12 2021

A278858 a(n) = permanent M_n where M_n is the n X n matrix m(i,j) = abs(i^2-j^2).

Original entry on oeis.org

1, 0, 9, 240, 36864, 7741440, 3363235524, 2203143038208, 2248347011420160, 3260265586467690240, 6578570637254005920000, 17755898734939822501524480, 62673017366111480630785474560, 282641923592380319367599892725760, 1599753679036773033206787507696238848
Offset: 0

Views

Author

Vaclav Kotesovec, Nov 29 2016

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[{1, Table[Permanent[Table[Abs[i^2-j^2], {i, 1, n}, {j, 1, n}]], {n, 1, 15}]}]
  • PARI
    {a(n) = matpermanent(matrix(n, n, i, j, abs(i^2-j^2)))}
    for(n=0, 20, print1(a(n), ", ")) \\ Vaclav Kotesovec, Aug 12 2021

A347768 Permanent of the n X n matrix with (j,k)-entry |j-k+1| (j,k = 1..n).

Original entry on oeis.org

1, 1, 8, 80, 1568, 42308, 1632544, 82377984, 5340729728, 429905599744, 42164608801024, 4944386388782080, 683353973472423936, 109907353260811403520, 20352830852731108528128, 4299139435513999926820864, 1027450150728092835655335936, 275824741022588671077713641472
Offset: 1

Views

Author

Zhi-Wei Sun, Sep 12 2021

Keywords

Comments

Conjecture: For any odd prime p, we have a(p) == 1/2 (mod p).
It is easy to show that for any integer n > 1 the determinant of the n X n matrix with (j,k)-entry |j-k+1| (j,k=1..n) has the value 2^(n-2).

Examples

			a(2) = 1 since the permanent of the matrix [|1-1+1|,|1-2+1|; |2-1+1|,|2-2+1|] = [1,0;2,1] has the value 1.
		

Crossrefs

Cf. A085807.

Programs

  • Mathematica
    a[n_]:=a[n]=Permanent[Table[Abs[j-k+1],{j,1,n},{k,1,n}]]
    Table[a[n],{n,1,22}]
  • PARI
    a(n) = matpermanent(matrix(n, n, j, k, abs(j-k+1))); \\ Michel Marcus, Sep 13 2021
    
  • Python
    from sympy import Matrix
    def A347768(n): return Matrix(n,n,[abs(j-k+1) for j in range(n) for k in range(n)]).per() # Chai Wah Wu, Sep 14 2021

A357503 a(n) is the hafnian of the 2n X 2n symmetric matrix whose element (i,j) equals abs(i-j).

Original entry on oeis.org

1, 1, 8, 174, 7360, 512720, 53245824, 7713320944, 1486382446592, 367691598791424, 113570289012090880
Offset: 0

Views

Author

Stefano Spezia, Oct 01 2022

Keywords

Examples

			a(2) = M_{1,2}*M_{3,4} + M_{1,3}*M_{2,4} + M_{1,4}*M_{2,3} = 8 is the hafnian of
    0, 1, 2, 3;
    1, 0, 1, 2;
    2, 1, 0, 1;
    3, 2, 1, 0.
		

Crossrefs

Cf. A049581, A085750 (determinant of M(n)), A085807 (permanent of M(n)), A094053 (super- and subdiagonal sums of M(n) in reversed order), A144216 (row- and column sums of M(n)), A338456.

Programs

  • Mathematica
    M[i_, j_, n_]:=Part[Part[Table[Abs[r-c], {r, n}, {c, n}], i], j]; a[n_]:=Sum[Product[M[Part[PermutationList[s, 2n], 2i-1], Part[PermutationList[s, 2n], 2i], 2n], {i, n}], {s, SymmetricGroup[2n]//GroupElements}]/(n!*2^n); Array[a, 6, 0]
  • PARI
    tm(n) = matrix(n, n, i, j, abs(i-j));
    a(n) = my(m = tm(2*n), s=0); forperm([1..2*n], p, s += prod(j=1, n, m[p[2*j-1], p[2*j]]); ); s/(n!*2^n); \\ Michel Marcus, May 02 2023

Extensions

a(6) from Michel Marcus, May 02 2023
a(7)-a(10) from Pontus von Brömssen, Oct 15 2023

A381514 a(n) is the hafnian of a symmetric Toeplitz matrix of order 2*n whose off-diagonal element (i,j) equals the |i-j|-th prime.

Original entry on oeis.org

1, 2, 23, 899, 85072, 15120411, 4439935299, 1989537541918, 1264044973158281, 1090056235155152713, 1227540523199054294506
Offset: 0

Views

Author

Stefano Spezia, Feb 25 2025

Keywords

Examples

			a(2) = 23 because the hafnian of
  [d  2  3  5]
  [2  d  2  3]
  [3  2  d  2]
  [5  3  2  d]
equals M_{1,2}*M_{3,4} + M_{1,3}*M_{2,4} + M_{1,4}*M_{2,3} = 2*2 + 3*3 + 5*2 = 23. Here d denotes the generic element on the main diagonal of the matrix from which the hafnian does not depend.
		

Crossrefs

Programs

  • Mathematica
    M[i_, j_]:=Prime[Abs[i-j]]; a[n_]:=Sum[Product[M[Part[PermutationList[s, 2n], 2i-1], Part[PermutationList[s, 2n], 2i]], {i, n}], {s, SymmetricGroup[2n]//GroupElements}]/(n!*2^n); Array[a, 5, 0]

Extensions

a(5)-a(10) from Pontus von Brömssen, Feb 26 2025
Previous Showing 11-18 of 18 results.