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-4 of 4 results.

A067276 Determinant of n X n matrix containing the first n^2 primes in increasing order.

Original entry on oeis.org

2, -1, -78, 880, -4656, -14304, -423936, 8342720, 711956736, -615707136, 21057138688, -4663930678272, 211912980656128, -9178450735677440, 40005919124799488, 83013253447139328, -8525111273818357760, -800258888289188708352, -15170733077495639179264
Offset: 1

Views

Author

Rick L. Shepherd, Feb 21 2002

Keywords

Comments

The first column contains the first n primes in increasing order, the second column contains the next n primes in increasing order, etc. Equivalently, first row contains first n primes in increasing order, second row contains next n primes in increasing order, etc. Sequences of determinants of matrices specifically containing primes include A024356 (Hankel matrix), A067549 (first n primes on diagonal, other elements 1), A066933 (cyclic permutations of first n primes in each row) and A067551 (first n primes on diagonal, other elements 0).

Examples

			a(3) = -78 because det[[2,7,17],[3,11,19],[5,13,23]] = -78 (= det[[2,3,5],[7,11,13],[17,19,23]], the determinant of the transpose.).
		

Crossrefs

Programs

  • Magma
    [ Determinant( Matrix(n, n, [ NthPrime(k): k in [1..n^2] ]) ): n in [1..19] ]; // Klaus Brockhaus, May 12 2010
    
  • Maple
    seq(LinearAlgebra:-Determinant(Matrix(n,n,(i,j) -> ithprime(n*(i-1)+j))),n=1..20); # Robert Israel, Jul 12 2017
  • Mathematica
    Table[ Det[ Partition[ Array[Prime, n^2], n]], {n, 19}] (* Robert G. Wilson v, May 26 2006 *)
  • PARI
    for(n=1,20,k=0; m=matrix(n,n,x,y, prime(k=k+1)); print1(matdet(m), ", ")) /* The matrix initialization command above fills columns first: Variables (such as) x and y take on values 1 through n for rows and columns, respectively, with x changing more rapidly and they must be specified even though the 5th argument is not an explicit function of them here. */
    
  • Python
    from sympy.matrices import Matrix
    from sympy import sieve
    def a(n):
        sieve.extend_to_no(n**2)
        return Matrix(n, n, sieve[1:n**2+1]).det()
    print([a(n) for n in range(1, 20)]) # Indranil Ghosh, Jul 31 2017

A118772 Determinant of n X n matrix containing the first n^2 3-almost primes in increasing order.

Original entry on oeis.org

8, -56, 156, 13328, -920, -83678, 1261988, 54252742, 214409844, -3528354250, 247094703588, -509185323508, 15154985424718, 884710401396570, 49777180907707320, -172913218088289027, 844641410704177098, 3066058962037715903, -33948947842497666568
Offset: 1

Views

Author

Jonathan Vos Post, May 22 2006

Keywords

Comments

3-almost prime analog of A067276 Determinant of n X n matrix containing the first n^2 primes in increasing order. The first column contains the first n 3-almost primes in increasing order, the second column contains the next n 3-almost primes in increasing order, etc. Equivalently, first row contains first n 3-almost primes in increasing order, second row contains next n 3-almost primes in increasing order, etc. See also: A118713 a(n) = semiprime circulant.

Examples

			a(2) = -56 because of the determinant -56 =
|8, 12|
18, 20|.
a(6) = -83678 because of the determinant -83678 =
| 8, 12, 18, 20, 27, 28|
| 30, 42, 44, 45, 50, 52|
| 63, 66, 68, 70, 75, 76|
| 78, 92, 98, 99, 102, 105|
| 110, 114, 116, 117, 124, 125|
| 130, 138, 147, 148, 153, 154|.
		

Crossrefs

Programs

  • Mathematica
    ThreeAlmostPrimePi[ n_ ] := Sum[ PrimePi[ n/(Prime @ i*Prime @ j) ] - j + 1, {i, PrimePi[ n^(1/3) ]}, {j, i, PrimePi@ Sqrt[ n/Prime @ i ]} ]; ThreeAlmostPrime[ n_ ] := Block[ {e = Floor[ Log[ 2, n ] + 1 ], a, b}, a = 2^e; Do[ b = 2^p; While[ ThreeAlmostPrimePi[ a ] < n, a = a + b ]; a = a - b/2, {p, e, 0, -1} ]; a + b/2 ]; Table[ Det[ Partition[ Array[ ThreeAlmostPrime, n^2 ], n ] ], {n, 19} ] (* Robert G. Wilson v, May 26 2006 *)
    With[{tap=Select[Range[4000],PrimeOmega[#]==3&]},Table[Det[ Partition[ Take[tap,n^2],n]],{n,20}]] (* Harvey P. Dale, Apr 17 2020 *)

Extensions

More terms from Robert G. Wilson v, May 26 2006
Typos in Mma program corrected by Giovanni Resta, Jun 12 2016

A118779 Determinant of n X n matrix containing the first n^2 4-almost primes in increasing order.

Original entry on oeis.org

16, -224, 0, 182016, 12734992, -80430368, -125120640, 1334967760, 1060202222660, -2759409121760, 54820105989504, -14148083510835712, 49989643415528010, 299304923505836144, 1713123391839442498, 93227182153040103540, -86403659709730762670
Offset: 1

Views

Author

Jonathan Vos Post, May 22 2006

Keywords

Comments

4-almost prime analog of A067276 Determinant of n X n matrix containing the first n^2 primes in increasing order. The first column contains the first n 4-almost primes (A014613) in increasing order, the second column contains the next n 4-almost primes in increasing order, etc. Equivalently, first row contains first n 4-almost primes in increasing order, second row contains next n 4-almost primes in increasing order, etc. See also: A118713 a(n) = semiprime circulant.

Examples

			a(2) = -224 because of the determinant -224 =
|16, 24|
|36, 40|.
a(3) = 0 because this matrix is singular: 0 =
|16, 24, 36|
|40, 54, 56|
|60, 81, 84|.
a(6) = -80430368 because of the determinant -80430368 =
| 16, 24, 36, 40, 54, 56|
| 60, 81, 84, 88, 90, 100|
| 104, 126, 132, 135, 136, 140|
| 150, 152, 156, 184, 189, 196|
| 198, 204, 210, 220, 225, 228|
| 232, 234, 248, 250, 260, 276|.
a(8) = 1334967760 =
| 16, 24, 36, 40, 54, 56, 60, 81|
| 84, 88, 90, 100, 104, 126, 132, 135|
|136, 140, 150, 152, 156, 184, 189, 196|
|198, 204, 210, 220, 225, 228, 232, 234|
|248, 250, 260, 276, 294, 296, 297, 306|
|308, 315, 328, 330, 340, 342, 344, 348|
|350, 351, 364, 372, 375, 376, 380, 390|
|414, 424, 441, 444, 459, 460, 462, 472|.
		

Crossrefs

Programs

  • Mathematica
    FourAlmostPrimePi[n_] := Sum[PrimePi[n/(Prime@i*Prime@j*Prime@k)] - k + 1, {i, PrimePi[n^(1/4)]}, {j, i, PrimePi[(n/Prime@i)^(1/3)]}, {k, j, PrimePi@Sqrt[n/(Prime@i*Prime@j)]}]; FourAlmostPrime[n_] := Block[{e = Floor[Log[2, n] + 1], a, b}, a = 2^e; Do[b = 2^p; While[FourAlmostPrimePi[a] < n, a = a + b]; a = a - b/2, {p, e, 0, -1}]; a + b/2]; Table[Det[Partition[Array[FourAlmostPrime, n^2], n]], {n, 17}] (* Robert G. Wilson v, May 26 2006 *)

Extensions

More terms from Robert G. Wilson v, May 26 2006

A321685 Determinant of n X n matrix containing the first n^2 composites in increasing order.

Original entry on oeis.org

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
Offset: 1

Views

Author

Felix Fröhlich, Nov 17 2018

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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
Showing 1-4 of 4 results.