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

A209297 Triangle read by rows: T(n,k) = k*n + k - n, 1 <= k <= n.

Original entry on oeis.org

1, 1, 4, 1, 5, 9, 1, 6, 11, 16, 1, 7, 13, 19, 25, 1, 8, 15, 22, 29, 36, 1, 9, 17, 25, 33, 41, 49, 1, 10, 19, 28, 37, 46, 55, 64, 1, 11, 21, 31, 41, 51, 61, 71, 81, 1, 12, 23, 34, 45, 56, 67, 78, 89, 100, 1, 13, 25, 37, 49, 61, 73, 85, 97, 109, 121, 1, 14, 27
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 19 2013

Keywords

Comments

From Michel Marcus, May 18 2021: (Start)
The n-th row of the triangle is the main diagonal of an n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows.
[1 2 3 4 5]
[1 2 3 4] [6 7 8 9 10]
[1 2 3] [5 6 7 8] [11 12 13 14 15]
[1 2] [4 5 6] [9 10 11 12] [16 17 18 19 20]
[1] [3 4] [7 8 9] [13 14 15 16] [21 22 23 24 25]
-----------------------------------------------------------
1 1 4 1 5 9 1 6 11 16 1 7 13 19 25
(End)

Examples

			From _Muniru A Asiru_, Oct 31 2017: (Start)
Triangle begins:
  1;
  1,  4;
  1,  5,  9;
  1,  6, 11, 16;
  1,  7, 13, 19, 25;
  1,  8, 15, 22, 29, 36;
  1,  9, 17, 25, 33, 41, 49;
  1, 10, 19, 28, 37, 46, 55, 64;
  1, 11, 21, 31, 41, 51, 61, 71, 81;
  1, 12, 23, 34, 45, 56, 67, 78, 89, 100;
  ... (End)
		

Crossrefs

Cf. A162610; A000012 (left edge), A000290 (right edge), A006003 (row sums), A001844 (central terms), A026741 (number of odd terms per row), A142150 (number of even terms per row), A221490 (number of primes per row).

Programs

  • GAP
    Flat(List([1..10^3], n -> List([1..n], k -> k * n + k - n))); # Muniru A Asiru, Oct 31 2017
  • Haskell
    a209297 n k = k * n + k - n
    a209297_row n = map (a209297 n) [1..n]
    a209297_tabl = map a209297_row [1..]
    
  • Mathematica
    Array[Range[1, #^2, #+1]&,10] (* Paolo Xausa, Feb 08 2024 *)

Formula

T(n,k) = (k-1)*(n+1)+1.

A344316 Number of primes appearing along the border of an n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows.

Original entry on oeis.org

0, 2, 3, 4, 5, 7, 7, 8, 8, 10, 9, 13, 12, 13, 12, 12, 13, 20, 14, 17, 17, 19, 16, 22, 18, 22, 19, 23, 19, 31, 18, 26, 24, 26, 25, 31, 18, 27, 28, 30, 22, 39, 25, 30, 31, 37, 26, 41, 29, 37, 32, 42, 28, 44, 31, 39, 30, 41, 32, 51, 33, 39, 40, 41, 36, 52, 35, 44, 39, 50, 39, 52, 39
Offset: 1

Views

Author

Wesley Ivan Hurt, May 14 2021

Keywords

Examples

			                                                      [1   2  3  4  5]
                                      [1   2  3  4]   [6   7  8  9 10]
                            [1 2 3]   [5   6  7  8]   [11 12 13 14 15]
                   [1 2]    [4 5 6]   [9  10 11 12]   [16 17 18 19 20]
           [1]     [3 4]    [7 8 9]   [13 14 15 16]   [21 22 23 24 25]
------------------------------------------------------------------------
  n         1        2         3            4                 5
------------------------------------------------------------------------
  a(n)      0        2         3            4                 5
------------------------------------------------------------------------
  primes   {}      {2,3}    {2,3,7}    {2,3,5,13}       {2,3,5,11,23}
------------------------------------------------------------------------
		

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[n] + PrimePi[n^2 - 1] - PrimePi[n*(n - 1)] + Sum[PrimePi[n*k + 1] - PrimePi[n*k], {k, n - 2}], {n, 100}]

Formula

a(n) = pi(n) + pi(n^2-1) - pi(n^2-n) + Sum_{k=1..n-2} (pi(n*k+1) - pi(n*k)).

A344349 Number of primes along the main antidiagonal of the n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows.

Original entry on oeis.org

0, 2, 3, 2, 3, 2, 6, 2, 3, 3, 6, 3, 7, 4, 7, 6, 6, 4, 10, 2, 8, 7, 9, 4, 11, 5, 10, 8, 11, 4, 17, 3, 10, 10, 12, 9, 16, 4, 10, 11, 14, 6, 21, 7, 11, 10, 16, 8, 19, 6, 19, 13, 17, 5, 25, 10, 19, 10, 16, 9, 27, 7, 16, 13, 16, 13, 31, 9, 18, 14, 27, 10, 26, 10, 20, 19, 17, 12, 30
Offset: 1

Views

Author

Wesley Ivan Hurt, May 15 2021

Keywords

Examples

			                                                      [1   2  3  4  5]
                                      [1   2  3  4]   [6   7  8  9 10]
                            [1 2 3]   [5   6  7  8]   [11 12 13 14 15]
                   [1 2]    [4 5 6]   [9  10 11 12]   [16 17 18 19 20]
           [1]     [3 4]    [7 8 9]   [13 14 15 16]   [21 22 23 24 25]
------------------------------------------------------------------------
  n         1        2         3            4                 5
------------------------------------------------------------------------
  a(n)      0        2         3            2                 3
------------------------------------------------------------------------
  primes   {}      {2,3}    {3,5,7}       {7,13}          {5,13,17}
------------------------------------------------------------------------
		

Crossrefs

Cf. A010051, A221490, A344316 (primes along border).

Programs

  • Mathematica
    Table[Sum[PrimePi[n*k - k + 1] - PrimePi[n*k - k], {k, n}], {n, 100}]

Formula

a(n) = Sum_{k=1..n} c(n*k-k+1), where c is the prime characteristic.

A221491 Number of primes of the form k*n - k + n, 1 <= k <= n.

Original entry on oeis.org

0, 1, 2, 2, 2, 2, 5, 2, 3, 3, 5, 3, 6, 4, 7, 6, 5, 4, 9, 2, 8, 7, 8, 4, 11, 5, 10, 8, 10, 4, 16, 3, 10, 10, 12, 9, 15, 4, 10, 11, 13, 6, 20, 7, 11, 10, 15, 8, 19, 6, 19, 13, 16, 5, 25, 10, 19, 10, 15, 9, 26, 7, 16, 13, 16, 13, 30, 9, 18, 14, 26, 10, 25, 10
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 19 2013

Keywords

Comments

a(n) = sum(A010051(A162610(n,k)): k=1..n) = number of primes in n-th row of the triangle in A162610. - Reinhard Zumkeller, Jan 19 2013

Examples

			Row 10 of A162610 = [19,28,37,46,55,64,73,82,91,100] containing three primes: [19,37,73], therefore a(10) = 3;
row 11 of A162610 = [21,31,41,51,61,71,81,91,101,111,121] containing five primes: [31,41,61,71,101], therefore a(11) = 5.
		

Crossrefs

Programs

  • Haskell
    a221491 n = sum [a010051' (k*n - k + n) | k <- [1..n]]
    
  • Mathematica
    a[n_] := Sum[Boole[PrimeQ[(k+1)(n-1)+1]], {k, 1, n}];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Sep 20 2021 *)
  • PARI
    a(n) = sum(k=1, n, isprime(k*n - k + n)); \\ Michel Marcus, Jan 26 2022

A367077 Determinant of the n X n matrix whose terms are the n^2 values of isprime(x) from 1 to n^2.

Original entry on oeis.org

0, -1, -1, 0, 1, 0, -2, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -15, 0, 0, 0, 0, 0, 400, 0, -196, 0, 0, 0, 0, 0, 4224, 0, 0, 0, -44304, 0, -537138, 0, 0, 0, -4152330, 0, 0, 0, 0, 0, -59171526, 0, 0, 0, 0, 0, -1681340912, 0, 330218571840, 0, 0, 0, 0, 0, -349982854480, 0, 0, 0
Offset: 1

Views

Author

Andres Cicuttin, Nov 05 2023

Keywords

Comments

Traces of these matrices are A221490.
Consider the sequence b(n) defined as 0 when a(n) is 0 and 1 otherwise. What is the value of the limit as n approaches infinity of Sum_{j<=n} b(j)/n provided that this limit exists?

Examples

			For n=4, we consider the first n^2=16 terms of the characteristic function of primes (A010051): (0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0). These terms form a matrix by arranging them in 4 consecutive subsequences of 4 terms each:
  0, 1, 1, 0;
  1, 0, 1, 0;
  0, 0, 1, 0;
  1, 0, 0, 0;
and the determinant of this matrix is zero, so a(4)=0.
		

Crossrefs

Programs

  • Mathematica
    mat[n_,i_,j_]:=Boole[PrimeQ[(i-1)*n+j]];
    a[n_]:=Det@Table[mat[n,i,j],{i,1,n},{j,1,n}];
    Table[a[n],{n,1,70}]
  • PARI
    a(n) = matdet(matrix(n, n, i, j, isprime((i-1)*n+j))); \\ Michel Marcus, Nov 07 2023
    
  • Python
    from sympy import Matrix, isprime
    def A367077(n): return Matrix(n,n,[int(isprime(i)) for i in range(1,n**2+1)]).det() # Chai Wah Wu, Nov 16 2023

A367133 Rank of the n X n matrix whose terms are the n^2 values of isprime(x) from 1 to n^2.

Original entry on oeis.org

0, 2, 3, 3, 5, 3, 7, 5, 7, 5, 11, 5, 11, 7, 9, 9, 16, 7, 19, 9, 13, 11, 23, 9, 20, 13, 19, 13, 29, 9, 31, 17, 21, 17, 25, 13, 37, 19, 25, 17, 41, 13, 43, 21, 25, 23, 47, 17, 43, 21, 33, 25, 53, 19, 41, 25, 37, 29, 59, 17, 61, 31, 37, 33, 49, 21, 67, 33, 45, 25
Offset: 1

Views

Author

Andres Cicuttin, Nov 06 2023

Keywords

Comments

Traces of these matrices are A221490.

Examples

			For n=4, we consider the first n^2=16 terms of the characteristic function of primes (A010051): (0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0). These terms form a matrix by arranging them in 4 consecutive subsequences of 4 terms each:
  0, 1, 1, 0;
  1, 0, 1, 0;
  0, 0, 1, 0;
  1, 0, 0, 0;
and the largest square submatrix with a nonzero determinant within this matrix is of dimension 3. Therefore, the rank is 3, and so a(4)=3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local i; LinearAlgebra:-Rank(Matrix(n,n,[seq(`if`(isprime(i),1,0),i=1..n^2)])) end proc:
    map(f, [$1..100]); # Robert Israel, Nov 11 2023
  • Mathematica
    mat[n_,i_,j_]:=Boole[PrimeQ[(i-1)*n+j]];
    a[n_]:=MatrixRank@Table[mat[n,i,j],{i,1,n},{j,1,n}];
    Table[a[n],{n,1,70}]
  • PARI
    a(n) = matrank(matrix(n, n, i, j, isprime((i-1)*n+j))); \\ Michel Marcus, Nov 07 2023
    
  • Python
    from sympy import Matrix, isprime
    def A367133(n): return Matrix(n,n,[int(isprime(i)) for i in range(1,n**2+1)]).rank() # Chai Wah Wu, Nov 16 2023

A350328 Numbers k such that pi(k) = Sum_{i=1..k} pi(k*(i-1)+i) - pi(k*(i-1)+i-1).

Original entry on oeis.org

1, 5, 21, 23, 25, 33, 81, 85, 115, 127, 141, 164, 253, 273, 283, 285, 291, 343, 385, 441, 471, 495, 505, 565, 577, 711, 807, 921, 1107, 1977, 2175, 2437, 2941, 2943, 3381, 4117, 5541, 6531, 7075, 7497, 8193, 8325, 8923
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 24 2021

Keywords

Comments

Numbers with the same number of primes on the top row and along the main diagonal of an n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows (see example).

Examples

			5 is in the sequence since there are 3 primes in the top row and 3 primes along the main diagonal of the 5 X 5 array below.
  [1   2  3  4  5]
  [6   7  8  9 10]
  [11 12 13 14 15]
  [16 17 18 19 20]
  [21 22 23 24 25]
		

Crossrefs

Cf. A000720 (pi), A221490.

Formula

Numbers k such that A000720(k) = A221490(k).

A342695 a(n) is the number of primes in an n X n square array that do not appear on its border, with the elements of the square array being the numbers from 1..n^2, listed in increasing order by rows.

Original entry on oeis.org

0, 0, 1, 2, 4, 4, 8, 10, 14, 15, 21, 21, 27, 31, 36, 42, 48, 46, 58, 61, 68, 73, 83, 83, 96, 100, 110, 114, 127, 123, 144, 146, 157, 165, 175, 179, 201, 201, 212, 221, 241, 235, 258, 265, 275, 282, 303, 301, 328, 330, 346, 351, 381, 377, 403, 406, 427, 433, 455, 452, 486, 493
Offset: 1

Views

Author

Wesley Ivan Hurt, May 18 2021

Keywords

Examples

			                                                      [1   2  3  4  5]
                                      [1   2  3  4]   [6   7  8  9 10]
                            [1 2 3]   [5   6  7  8]   [11 12 13 14 15]
                   [1 2]    [4 5 6]   [9  10 11 12]   [16 17 18 19 20]
           [1]     [3 4]    [7 8 9]   [13 14 15 16]   [21 22 23 24 25]
------------------------------------------------------------------------
  n         1        2         3            4                 5
------------------------------------------------------------------------
  a(n)      0        0         1            2                 4
------------------------------------------------------------------------
  primes   {}       {}        {5}        {7,11}         {7,13,17,19}
------------------------------------------------------------------------
		

Crossrefs

Cf. A000720 (pi), A038107, A221490, A344316 (on border), A344349.

Programs

  • Mathematica
    Table[PrimePi[n*(n - 1)] - PrimePi[n] - Sum[PrimePi[n*k + 1] - PrimePi[n*k], {k, n - 2}], {n, 100}]

Formula

a(n) = pi(n*(n-1)) - pi(n) - Sum_{k=1..n-2} (pi(n*k+1) - pi(n*k)).

A350377 Numbers k such that Sum_{j=1..k} (pi(k*j-j+1) - pi(k*j-j)) = Sum_{i=1..k} (pi(k*(i-1)+i) - pi(k*(i-1)+i-1)).

Original entry on oeis.org

1, 5, 8, 10, 11, 12, 14, 21, 23, 24, 27, 63, 64, 72, 90, 99, 144, 176, 184, 340, 366, 393, 480, 567, 693, 915, 975, 1046, 1068, 1084, 1260, 1410, 1452, 1830, 1968, 2268, 2490, 2943, 3087, 3735, 5284, 5426, 5637, 5757, 6015, 6334, 6393, 6570, 6582, 8292, 9836, 10005
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 28 2021

Keywords

Comments

Numbers with the same number of primes appearing along the main diagonal and along the main antidiagonal of an n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows (see example).

Examples

			5 is in the sequence since there are 3 primes along the main diagonal and 3 primes along the main antidiagonal of the 5 X 5 array below.
  [1   2  3  4  5]
  [6   7  8  9 10]
  [11 12 13 14 15]
  [16 17 18 19 20]
  [21 22 23 24 25]
		

Crossrefs

Programs

  • Mathematica
    q[k_] := Sum[Boole @ PrimeQ[k*j - j + 1] - Boole @ PrimeQ[k*(j - 1) + j], {j, 1, k}] == 0; Select[Range[1000], q] (* Amiram Eldar, Dec 28 2021 *)

Formula

Numbers k such that A221490(k) = A344349(k).

Extensions

More terms from Amiram Eldar, Dec 28 2021
Showing 1-9 of 9 results.