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.

Showing 1-6 of 6 results.

A071078 Determinant of the n X n matrix whose element (i,j) equals the |i-j|-th prime or if i=j, 1.

Original entry on oeis.org

1, 1, -3, 8, -21, 45, -81, -504, -327, -95, -27, 3744, -514125, 42577129, -594343521, 6384803528, 55828902985, 222653960625, -24898185972135, 370012327363008, -5108693773098321, 66203904684406485, -696661740301346521, 5010137735370840432, -22341106332701627463
Offset: 0

Views

Author

Robert G. Wilson v, May 26 2002

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Det[ Table[ If[ i == j, 1, Prime[ Abs[i - j]]], {i, 1, n}, {j, 1, n}]]; Table[ f[n], {n, 1, 21}]

Extensions

More terms from Sean A. Irvine, Jun 27 2024
a(0)=1 prepended by Alois P. Heinz, Jun 27 2024

A071079 Determinant of the n X n matrix whose element (i,j) equals the |i-j|-th prime or if i=j, 0.

Original entry on oeis.org

1, 0, -4, 24, -135, 696, -3577, 8738, -21120, 7182, 85995, 307692, -4739379, 72588316, 1042545852, 13023653868, -40433805531, -160245671048, 2415459163787, 80057252715814, -4733090488738644, 277504161503477090, -7200884073495803561, 97750528494490914120
Offset: 0

Views

Author

Robert G. Wilson v, May 26 2002

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> LinearAlgebra[Determinant](Matrix(n,
       (i, j)-> `if`(i=j, 0, ithprime(abs(i-j))))):
    seq(a(n), n=0..24);  # Alois P. Heinz, Jun 27 2024
  • Mathematica
    f[n_] := Det[ Table[ If[ i == j, 0, Prime[ Abs[i - j]]], {i, 1, n}, {j, 1, n}]]; Table[ f[n], {n, 1, 20}]

Extensions

More terms from Sean A. Irvine, Jun 27 2024
a(0)=1 prepended by Alois P. Heinz, Jun 27 2024

A071080 Determinant of the n X n matrix whose element (i,j) equals the |i-j|-th composite number, or 1 if i=j.

Original entry on oeis.org

1, -15, 125, -935, 6096, -38340, 240864, -1497584, 8611328, -49201152, 277473280, -1541996288, 7852493824, -39972516864, 195624648704, -789661486080, 3052709008384, -9659706075392, 30089357409792, -63825905935360, 63965499203712, -8296932715920, -1139418909751008
Offset: 1

Views

Author

Robert G. Wilson v, May 26 2002

Keywords

Crossrefs

Cf. A374069 (permanent).

Programs

  • Maple
    comps:= remove(isprime,[$4 .. 1000]):
    f:= proc(n) local M;
      M:= Matrix(n,n,(i,j) -> `if`(i=j,1,comps[abs(i-j)]));
      LinearAlgebra:-Determinant(M)
    end proc:
    map(f, [$1..25]); # Robert Israel, Dec 03 2024
  • Mathematica
    Composite[n_Integer] := FixedPoint[n + PrimePi[ # ] + 1 &, n + PrimePi[n] + 1]; f[n_] := Det[ Table[ If[i == j, 1, Composite[ Abs[i - j]]], {i, 1, n}, {j, 1, n}]]; Table[ f[n], {n, 1, 20}]

Extensions

a(21)-a(23) from Stefano Spezia, Jun 27 2024

A071081 Determinant of the n X n matrix whose element (i,j) equals the |i-j|-th composite number, or 0 if i=j.

Original entry on oeis.org

1, 0, -16, 192, -1904, 16416, -134608, 1102920, -8971103, 69262338, -527129920, 4002967800, -30263030000, 218133853800, -1565386817920, 11130108480678, -75244171093875, 496516351214832, -3261752198331472, 21401161780748720, -140093238345715827, 914525302322457472
Offset: 0

Views

Author

Robert G. Wilson v, May 26 2002

Keywords

Crossrefs

Cf. A374070 (permanent).

Programs

  • Maple
    comps:= remove(isprime,[$4 .. 11000]):
    f:= proc(n) local M;
      M:= Matrix(n,n,(i,j) -> `if`(i=j,0,comps[abs(i-j)]));
      LinearAlgebra:-Determinant(M)
    end proc:
    f(0):= 1:
    map(f, [$0..25]); # Robert Israel, Dec 02 2024
  • Mathematica
    Composite[n_Integer] := FixedPoint[n + PrimePi[ # ] + 1 &, n + PrimePi[n] + 1]; f[n_] := Det[ Table[ If[i == j, 0, Composite[ Abs[i - j]]], {i, 1, n}, {j, 1, n}]]; Table[ f[n], {n, 1, 20}]
  • PARI
    a(n) = my(composite(n)=my(k=-1); while(-n+n+=-k+k=primepi(n), ); n); matdet(matrix(n, n, i, j, if(i==j, 0, composite(abs(i-j))))); \\ Ruud H.G. van Tol, Jul 14 2024
  • Python
    from sympy import Matrix, composite
    def A071081(n): return Matrix(n,n,[composite(abs(j-k)) if j!=k else 0 for j in range(n) for k in range(n)]).det() # Chai Wah Wu, Jul 01 2024
    

Extensions

a(21) from Stefano Spezia, Jun 27 2024
a(0)=1 prepended by Alois P. Heinz, Jul 01 2024

A085510 Permanent of the n X n matrix whose element (i,j) equals phi(|i-j|).

Original entry on oeis.org

0, 1, 2, 16, 150, 2757, 56252, 1843637, 71277004, 3592359440, 197924252436, 14915743198773, 1183551535975484, 123024814715081453, 13742505172992983210, 1747020721154054373156, 240574984100927602314902
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 19 2003

Keywords

Examples

			a(3)=2 because phi(0)=0, phi(1)=phi(2)=1 and so the matrix is [[0,1,1],[1,0,1],[1,1,0]] with permanent 2.
		

Crossrefs

Cf. A071083.

Programs

  • Maple
    with(numtheory): with(linalg): p:=(i,j)->phi(abs(i-j)): seq(permanent(matrix(n,n,p)),n=1..16); # Emeric Deutsch, Dec 17 2004
  • Mathematica
    a[n_] := Permanent[Table[EulerPhi[Abs[i-j]], {i, 1, n}, {j, 1, n}]]; Table[ an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 17}] (* Jean-François Alcover, Jan 07 2016 *)
  • PARI
    aph(n)={n=abs(n);if(n>0,eulerphi(n),0);}
    a(n)=matpermanent(matrix(n,n,r,c,aph(r-c)));
    vector(23,n,a(n)) \\ Joerg Arndt, Aug 15 2019

Extensions

More terms from Emeric Deutsch, Dec 17 2004

A354865 a(n) is the hafnian of the 2n X 2n symmetric matrix whose element M_{i,j} equals phi(abs(i-j)).

Original entry on oeis.org

1, 1, 4, 49, 1193, 50228, 3098989, 271913937, 31382686354, 4668707087571, 880702869805775
Offset: 0

Views

Author

Stefano Spezia, Sep 30 2022

Keywords

Examples

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

Crossrefs

Cf. A071083 (determinant of M(n)), A085510 (permanent of M(n)).

Programs

  • Mathematica
    M[i_, j_, n_]:=Part[Part[Table[EulerPhi[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
    aphi(n) = n=abs(n); if(n>0, eulerphi(n), 0);
    tm(n) = matrix(n, n, i, j, aphi(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 14 2023
Showing 1-6 of 6 results.