OFFSET
1,1
LINKS
EXAMPLE
For n = 3: The matrix consisting of the initial 3^2 = 9 composites is
--- ---
| 4 6 8 |
| 9 10 12 |
| 14 15 16 |
--- ---
The determinant of the matrix is 24, so a(3) = 24.
MATHEMATICA
composite[n_] := FixedPoint[n + PrimePi[#] + 1 &, n + PrimePi[n] + 1]; a[n_] := Det[ArrayReshape[Array[composite, n^2], {n, n}]]; Array[a, 40] (* Amiram Eldar, Nov 17 2018 after Robert G. Wilson v at A002808 *)
Module[{nn=40, cmps}, cmps=Select[Range[2nn^2], CompositeQ]; Table[Det[ Partition[ Take[cmps, n^2], n]], {n, nn}]] (* Harvey P. Dale, Aug 10 2021 *)
PROG
(PARI) composite(n) = my(i=0); forcomposite(c=1, , i++; if(i==n, return(c)))
compositepi(n) = my(i=0); if(n==4, return(1), forcomposite(c=1, n, i++)); i
compositesquare(n) = if(n==1, return(Mat([4]))); my(s=""); forcomposite(c=1, composite(n^2), s=concat(s, Str(c)); if(compositepi(c)%n==0 && c!=composite(n^2), s=concat(s, "; "), if(c!=composite(n^2), s=concat(s, ", ")))); s=concat("[", s); s=concat(s, "]")
a(n) = matdet(eval(compositesquare(n)))
(PARI) a(n) = my (m=matrix(n, n), r=1, c=1); forcomposite(k=1, , m[r, c] = k; r++; if (r>n, r=1; c++; if (c>n, return (matdet(m))))) \\ Rémy Sigrist, Nov 17 2018
(Python)
from sympy import Array, Matrix, composite
def A321685(n):
return Matrix(Array((composite(i) for i in range(1, n**2+1)), (n, n))).det() # Chai Wah Wu, Sep 08 2020
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Felix Fröhlich, Nov 17 2018
STATUS
approved