login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A321685 Determinant of n X n matrix containing the first n^2 composites in increasing order. 1
4, -12, 24, 0, -51, 0, 262, -126, 0, -1684, -47, 0, 480, 0, -854, 4349, 0, -2690, 10595, 0, 9074, 9680, 37734, -48262, 1200, -98037, 415504, -1687656, -1840201, 2208435, -24907680, -20571545, -2873052, 23511040, 255110496, 98995966, -17722962796, 3495484872 (list; graph; refs; listen; history; text; internal format)
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
Sequence in context: A009905 A008047 A008065 * A156678 A277513 A319887
KEYWORD
easy,sign
AUTHOR
Felix Fröhlich, Nov 17 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)