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-10 of 12 results. Next

A154720 Triangle read by rows in which row n lists 2n-1 terms: n, in the center of the row and all the pairs of noncomposite numbers equidistant to n, with 0's inserted, as shown below in the example.

Original entry on oeis.org

1, 1, 2, 3, 1, 0, 3, 0, 5, 1, 0, 3, 4, 5, 0, 7, 0, 0, 3, 0, 5, 0, 7, 0, 0, 1, 0, 0, 0, 5, 6, 7, 0, 0, 0, 11, 1, 0, 3, 0, 0, 0, 7, 0, 0, 0, 11, 0, 13, 0, 0, 3, 0, 5, 0, 0, 8, 0, 0, 11, 0, 13, 0, 0, 1, 0, 0, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 0, 0, 17
Offset: 1

Views

Author

Omar E. Pol, Jan 14 2009

Keywords

Examples

			Triangle begins:
                           1
                        1  2  3
                     1  0  3  0  5
                  1  0  3  4  5  0  7
               0  0  3  0  5  0  7  0  0
            1  0  0  0  5  6  7  0  0  0 11
         1  0  3  0  0  0  7  0  0  0 11  0 13
      0  0  3  0  5  0  0  8  0  0 11  0 13  0  0
   1  0  0  0  5  0  7  0  9  0 11  0 13  0  0  0 17
1  0  3  0  0  0  7  0  0 10  0  0 13  0  0  0 17  0 19
		

Crossrefs

Programs

  • Maple
    isnotcomp:=proc(n)return (n=1 or isprime(n)) end:
    for n from 1 to 10 do for k from 1 to 2*n-1 do if(k=n or (isnotcomp(k) and isnotcomp(2*n-k)))then print(k):else print(0):fi:od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    Flatten@Table[If[k == n  || ( !CompositeQ[k] && !CompositeQ[2 n - k]), k, 0], {n, 10}, {k, 2 n - 1}] (* Robert Price, Apr 26 2025 *)

A154721 Triangle read by rows in which row n lists 2n-1 terms: The pairs of noncomposite numbers equidistant to n, with 0's inserted, as shown below in the example.

Original entry on oeis.org

0, 1, 0, 3, 1, 0, 0, 0, 5, 1, 0, 3, 0, 5, 0, 7, 0, 0, 3, 0, 0, 0, 7, 0, 0, 1, 0, 0, 0, 5, 0, 7, 0, 0, 0, 11, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 11, 0, 13, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0, 11, 0, 13, 0, 0, 1, 0, 0, 0, 5, 0, 7, 0, 0, 0, 11, 0, 13, 0, 0, 0, 17
Offset: 1

Views

Author

Omar E. Pol, Jan 14 2009

Keywords

Examples

			Triangle begins:
                           0
                        1  0  3
                     1  0  0  0  5
                  1  0  3  0  5  0  7
               0  0  3  0  0  0  7  0  0
            1  0  0  0  5  0  7  0  0  0 11
         1  0  3  0  0  0  0  0  0  0 11  0 13
      0  0  3  0  5  0  0  0  0  0 11  0 13  0  0
   1  0  0  0  5  0  7  0  0  0 11  0 13  0  0  0 17
1  0  3  0  0  0  7  0  0  0  0  0 13  0  0  0 17  0 19
		

Crossrefs

Programs

  • Maple
    isnotcomp:=proc(n)return (n=1 or isprime(n)) end:
    for n from 1 to 10 do for k from 1 to 2*n-1 do if(not k=n and (isnotcomp(k) and isnotcomp(2*n-k)))then print(k):else print(0):fi:od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    T[n_, k_] := If[k != n && !CompositeQ[k] && !CompositeQ[2n - k], k, 0];
    Table[T[n, k], {n, 1, 10}, {k, 1, 2n - 1}] // Flatten (* Jean-François Alcover, Dec 04 2017 *)

A154722 Triangle read by rows in which row n lists: n, in the center of the row and the pairs of noncomposite numbers that are equidistant to n, as shown below in the example.

Original entry on oeis.org

1, 1, 2, 3, 1, 3, 5, 1, 3, 4, 5, 7, 3, 5, 7, 1, 5, 6, 7, 11, 1, 3, 7, 11, 13, 3, 5, 8, 11, 13, 1, 5, 7, 9, 11, 13, 17, 1, 3, 7, 10, 13, 17, 19, 3, 5, 11, 17, 19, 1, 5, 7, 11, 12, 13, 17, 19, 23, 3, 7, 13, 19, 23, 5, 11, 14, 17, 23, 1, 7, 11, 13, 15
Offset: 1

Views

Author

Omar E. Pol, Jan 14 2009

Keywords

Examples

			Triangle begins:
. . . . . . . . . . . . . . .1
. . . . . . . . . . . . . 1, 2, 3
. . . . . . . . . . . .1, .. 3, .. 5
. . . . . . . . . . 1, .. 3, 4, 5, .. 7
. . . . . . . . ... .. 3, .. 5, .. 7, .. .
. . . . . . . 1, .. .. .. 5, 6, 7, .. .. .,11
. . . . . .1, .. 3, .. .. .. 7, .. .. ..11, ..13
. . . . .. .. 3, .. 5, .. .. 8, .. ..11, ..13, .. .
. . .1, .. .. .. 5, .. 7, .. 9, ..11, ..13, .. .. ..17
. 1, .. 3, .. .. .. 7, .. .,10, .. ..13, .. .. ..17, ..19
		

Crossrefs

Programs

  • Maple
    isnotcomp:=proc(n)return (n=1 or isprime(n)) end:
    for n from 1 to 10 do for k from 1 to 2*n-1 do if(k=n or (isnotcomp(k) and isnotcomp(2*n-k)))then print(k):fi:od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    Select[Flatten@Table[If[k == n  || ! CompositeQ[k] && ! CompositeQ[2 n - k], k, 0], {n, 10}, {k, 2 n - 1}], # > 0 &]  (* Robert Price, Apr 26 2025 *)

Extensions

a(45) - a(73) from Nathaniel Johnston, Apr 18 2011

A154723 Triangle read by rows in which row n lists all the pairs of noncomposite numbers that are equidistant from n, or only n if there are no such pairs, as shown below in the example.

Original entry on oeis.org

1, 1, 3, 1, 5, 1, 3, 5, 7, 3, 7, 1, 5, 7, 11, 1, 3, 11, 13, 3, 5, 11, 13, 1, 5, 7, 11, 13, 17, 1, 3, 7, 13, 17, 19, 3, 5, 17, 19, 1, 5, 7, 11, 13, 17, 19, 23, 3, 7, 19, 23, 5, 11, 17, 23, 1, 7, 11, 13, 17, 19, 23, 29, 1, 3, 13, 19, 29, 31, 3
Offset: 1

Views

Author

Omar E. Pol, Jan 14 2009, Jan 16 2009

Keywords

Comments

If the extended Goldbach conjecture is true, such a pair exists in row n for all n >= 2. - Nathaniel Johnston, Apr 18 2011

Examples

			Triangle begins:
                             1
                          1,    3
                       1,          5
                    1,    3,    5,    7
                       3,          7,
              1,          5,    7,         11
           1,    3,                     11,   13
              3,    5,               11,   13,
     1,          5,    7,         11,   13,         17
  1,    3,          7,               13,         17,   19
		

Crossrefs

Programs

  • Maple
    isnotcomp:=proc(n)return (n=1 or isprime(n)) end:
    print(1):for n from 1 to 10 do for k from 1 to 2*n-1 do if(not k=n and (isnotcomp(k) and isnotcomp(2*n-k)))then print(k):fi:od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    Table[If[Length@ # == 1, #, DeleteCases[#, n]] &@ Union@ Flatten@ Select[IntegerPartitions[2 n, {2}], AllTrue[#, ! CompositeQ@ # &] &], {n, 17}] // Flatten (* Michael De Vlieger, Dec 06 2018 *)

Extensions

a(36)-a(70) from Nathaniel Johnston, Apr 18 2011

A154724 Triangle read by rows in which row n lists 2n-1 terms: n, in the center of the row and the pairs of prime numbers that are equidistant to n, with 0's inserted, as shown below in the example.

Original entry on oeis.org

1, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 3, 4, 5, 0, 0, 0, 0, 3, 0, 5, 0, 7, 0, 0, 0, 0, 0, 0, 5, 6, 7, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 11, 0, 0, 0, 0, 3, 0, 5, 0, 0, 8, 0, 0, 11, 0, 13, 0, 0, 0, 0, 0, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 0, 0, 0
Offset: 1

Views

Author

Omar E. Pol, Jan 14 2009

Keywords

Examples

			Triangle begins:
                             1
                          0, 2, 0
                       0, 0, 3, 0, 0
                    0, 0, 3, 4, 5, 0, 0
                 0, 0, 3, 0, 5, 0, 7, 0, 0
              0, 0, 0, 0, 5, 6, 7, 0, 0, 0, 0
           0, 0, 3, 0, 0, 0, 7, 0, 0, 0,11, 0, 0
        0, 0, 3, 0, 5, 0, 0, 8, 0, 0,11, 0,13, 0, 0
     0, 0, 0, 0, 5, 0, 7, 0, 9, 0,11, 0,13, 0, 0, 0, 0
  0, 0, 3, 0, 0, 0, 7, 0, 0,10, 0, 0,13, 0, 0, 0,17, 0, 0
		

Crossrefs

Programs

  • Maple
    for n from 1 to 10 do for k from 1 to 2*n-1 do if(k=n or (isprime(k) and isprime(2*n-k)))then print(k):else print(0):fi:od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    Flatten@Table[If[k == n  || ( PrimeQ[k] && PrimeQ[2 n - k]), k, 0], {n, 10}, {k, 2 n - 1}] (* Robert Price, Apr 26 2025 *)

A154725 Triangle read by rows in which row n lists 2n-1 terms: The pairs of prime numbers that are equidistant to n, with 0's inserted, as shown below in the example.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 5, 0, 7, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0, 11, 0, 13, 0, 0, 0, 0, 0, 0, 5, 0, 7, 0, 0, 0, 11, 0, 13, 0, 0, 0, 0
Offset: 1

Views

Author

Omar E. Pol, Jan 14 2009

Keywords

Comments

Each entry of the n-th row is either 0 or a prime p from the 2n-th row of A002260 such that 2n-p is also prime. - Jason Kimberley, Jul 08 2012

Examples

			Triangle begins:
                             0
                          0, 0, 0
                       0, 0, 0, 0, 0
                    0, 0, 3, 0, 5, 0, 0
                 0, 0, 3, 0, 0, 0, 7, 0, 0
              0, 0, 0, 0, 5, 0, 7, 0, 0, 0, 0
           0, 0, 3, 0, 0, 0, 0, 0, 0, 0,11, 0, 0
        0, 0, 3, 0, 5, 0, 0, 0, 0, 0,11, 0,13, 0, 0
     0, 0, 0, 0, 5, 0, 7, 0, 0, 0,11, 0,13, 0, 0, 0, 0
  0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0,13, 0, 0, 0,17, 0, 0
From _Jason Kimberley_, Jul 08 2012: (Start)
Square array begins:
   3,    3,    3,    0,    3,    3,    0,    3,    3, ...
      0,    0,    0,    0,    0,    0,    0,    0, ...
   5,    5,    5,    0,    5,    5,    0,    5, ...
      0,    0,    0,    0,    0,    0,    0, ...
   7,    7,    7,    0,    7,    7,    0, ...
      0,    0,    0,    0,    0,    0, ...
   0,    0,    0,    0,    0,    0, ...
      0,    0,    0,    0,    0, ...
  11,   11,   11,    0,   11, ...
      0,    0,    0,    0, ...
  13,   13,   13,    0, ...
      0,    0,    0, ...
   0,    0,    0, ...
      0,    0, ...
  17,   17, ...
      0, ...
  19, ...
(End)
		

Crossrefs

Programs

  • Maple
    for n from 1 to 10 do for k from 1 to 2*n-1 do if(not k=n and (isprime(k) and isprime(2*n-k)))then print(k):else print(0):fi:od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    Flatten@Table[If[k != n  &&  PrimeQ[k] && PrimeQ[2 n - k], k, 0], {n, 10}, {k, 2 n - 1}] (* Robert Price, Apr 26 2025 *)

A154726 Triangle read by rows in which row n lists: n, in the center of the row and the pairs of prime numbers that are equidistant to n, as shown below in the example.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 3, 5, 7, 5, 6, 7, 3, 7, 11, 3, 5, 8, 11, 13, 5, 7, 9, 11, 13, 3, 7, 10, 13, 17, 3, 5, 11, 17, 19, 5, 7, 11, 12, 13, 17, 19, 3, 7, 13, 19, 23, 5, 11, 14, 17, 23, 7, 11, 13, 15, 17, 19, 23, 3, 13, 16, 19, 29, 3, 5, 11, 17, 23, 29
Offset: 1

Views

Author

Omar E. Pol, Jan 14 2009

Keywords

Examples

			Triangle begins:
                       1
                       2
                       3
                    3  4  5
                 3  .  5  .  7
              .  .  5  6  7  .  .
           3  .  .  .  7  .  .  . 11
        3  .  5  .  .  8  .  . 11  . 13
     .  .  5  .  7  .  9  . 11  . 13  .  .
  3  .  .  .  7  .  . 10  .  . 13  .  .  . 17
		

Crossrefs

Programs

  • Maple
    for n from 1 to 10 do for k from 1 to 2*n-1 do if(k=n or (isprime(k) and isprime(2*n-k)))then print(k):fi:od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    Select[Flatten@Table[If[k == n  || ( PrimeQ[k] && PrimeQ[2 n - k]), k, 0], {n, 10}, {k, 2 n - 1}] , # > 0 &] (* Robert Price, Apr 26 2025 *)

Extensions

a(31)-a(70) from Nathaniel Johnston, Apr 18 2011

A171637 Triangle read by rows in which row n lists the distinct primes of the distinct decompositions of 2n into unordered sums of two primes.

Original entry on oeis.org

2, 3, 3, 5, 3, 5, 7, 5, 7, 3, 7, 11, 3, 5, 11, 13, 5, 7, 11, 13, 3, 7, 13, 17, 3, 5, 11, 17, 19, 5, 7, 11, 13, 17, 19, 3, 7, 13, 19, 23, 5, 11, 17, 23, 7, 11, 13, 17, 19, 23, 3, 13, 19, 29, 3, 5, 11, 17, 23, 29, 31, 5, 7, 13, 17, 19, 23, 29, 31, 7, 19, 31, 3, 11, 17, 23, 29, 37, 5, 11
Offset: 2

Views

Author

Juri-Stepan Gerasimov, Dec 13 2009

Keywords

Comments

Each entry of the n-th row is a prime p from the n-th row of A002260 such that 2n-p is also prime. If A002260 is read as the antidiagonals of a square array, this sequence can be read as an irregular square array (see example below). The n-th row has length A035026(n). This sequence is the nonzero subsequence of A154725. - Jason Kimberley, Jul 08 2012

Examples

			a(2)=2 because for row 2: 2*2=2+2; a(3)=3 because for row 3: 2*3=3+3; a(4)=3 and a(5)=5 because for row 4: 2*4=3+5; a(6)=3, a(7)=5 and a(8)=7 because for row 5: 2*5=3+7=5+5.
The table starts:
2;
3;
3,5;
3,5,7;
5,7;
3,7,11;
3,5,11,13;
5,7,11,13;
3,7,13,17;
3,5,11,17,19;
5,7,11,13,17,19;
3,7,13,19,23;
5,11,17,23;
7,11,13,17,19,23;
3,13,19,29;
3,5,11,17,23,29,31;
As an irregular square array [_Jason Kimberley_, Jul 08 2012]:
3 . 3 . 3 . . . 3 . 3 . . . 3 . 3
. . . . . . . . . . . . . . . .
5 . 5 . 5 . . . 5 . 5 . . . 5
. . . . . . . . . . . . . .
7 . 7 . 7 . . . 7 . 7 . .
. . . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . .
11. 11. 11. . . 11
. . . . . . . .
13. 13. 13. .
. . . . . .
. . . . .
. . . .
17. 17
. .
19
		

Crossrefs

Related triangles: A154720, A154721, A154722, A154723, A154724, A154725, A154726, A154727, A184995. - Jason Kimberley, Sep 03 2011
Cf. A020481 (left edge), A020482 (right edge), A238778 (row sums), A238711 (row products), A000040, A010051.

Programs

  • Haskell
    a171637 n k = a171637_tabf !! (n-2) !! (k-1)
    a171637_tabf = map a171637_row [2..]
    a171637_row n = reverse $ filter ((== 1) . a010051) $
       map (2 * n -) $ takeWhile (<= 2 * n) a000040_list
    -- Reinhard Zumkeller, Mar 03 2014
  • Mathematica
    Table[ps = Prime[Range[PrimePi[2*n]]]; Select[ps, MemberQ[ps, 2*n - #] &], {n, 2, 50}] (* T. D. Noe, Jan 27 2012 *)

Extensions

Keyword:tabl replaced by tabf, arbitrarily defined a(1) removed and entries checked by R. J. Mathar, May 22 2010
Definition clarified by N. J. A. Sloane, May 23 2010

A154786 Row sums of triangle in A154725.

Original entry on oeis.org

0, 0, 0, 8, 10, 12, 14, 32, 36, 40, 44, 72, 52, 56, 90, 64, 102, 144, 38, 120, 168, 132, 138, 240, 200, 156, 270, 168, 174, 360, 124, 320, 396, 136, 350, 432, 296, 380, 546, 320, 328, 672, 344, 352, 810, 368, 376, 672, 294, 600, 816, 520, 530, 864, 660, 784, 1140
Offset: 1

Views

Author

Omar E. Pol, Jan 15 2009, Jan 16 2009

Keywords

Crossrefs

Programs

  • Maple
    A154786 := proc(n) local a,d; a := 0 ; for d from 1 to n-2 do if isprime(n-d) and isprime(n+d) then a := a+2*n; fi; od: a ; end: for n from 1 to 80 do printf("%d,",A154786(n)) ; od: # R. J. Mathar, Jan 18 2009

Formula

a(n) = A154785(n) - n.
a(n) = A005843(n)*A061357(n). - Omar E. Pol, Jan 20 2009

Extensions

Edited by Omar E. Pol, Jan 17 2009
Extended by R. J. Mathar, Jan 18 2009

A184995 Irregular triangle T, read by rows, in which row n lists the primes p <= n such that 2n-p is also prime.

Original entry on oeis.org

2, 3, 3, 3, 5, 5, 3, 7, 3, 5, 5, 7, 3, 7, 3, 5, 11, 5, 7, 11, 3, 7, 13, 5, 11, 7, 11, 13, 3, 13, 3, 5, 11, 17, 5, 7, 13, 17, 7, 19, 3, 11, 17, 5, 11, 13, 19, 3, 7, 13, 3, 5, 17, 23, 5, 7, 11, 17, 19, 3, 7, 13, 19, 5, 11, 23, 7, 11, 13, 17, 23, 3, 13, 19, 5, 11, 17, 29, 7, 13, 17, 19, 23, 29
Offset: 2

Views

Author

Jason Kimberley, Sep 03 2011

Keywords

Comments

Row n has first entry A020481(n), length A045917(n), and last entry A112823(n).
Each row is the prefix to the middle of the corresponding row of A171637.
The Goldbach conjecture states that this irregular Goldbach triangle has in each row at least one entry (A045917(n) >= 1). - Wolfdieter Lang, May 14 2016

Examples

			The irregular triangle T(n, i) starts:
n, 2*n\i  1   2   3   4   5   6 ...
2,   4    2
3,   6    3
4,   8    3
5,  10    3   5
6,  12    5
7,  14    3   7
8,  16    3   5
9,  18    5   7
10, 20    3   7
11, 22    3   5  11
12, 24    5   7  11
13, 26    3   7  13
14, 28    5  11
15, 30    7  11  13
16, 32    3  13
17, 34    3   5  11  17
18, 36    5   7  13  17
19, 38    7  19
20, 40    3  11  17
21, 42    5  11  13  19
22, 44    3   7  13
23, 46    3   5  17  23
24, 48    5   7  11  17  19
25, 50    3   7  13  19
26, 52    5  11  23
27, 54    7  11  13  17  23
28, 56    3  13  19
29, 58    5  11  17  29
30, 60    7  13  17  19  23  29
... reformatted - _Wolfdieter Lang_, May 14 2016
		

Crossrefs

Programs

  • Magma
    A184995 := func;
    &cat[A184995(n):n in [2..30]];
  • Maple
    T:= n-> seq(`if`(andmap(isprime, [p, 2*n-p]), p, NULL), p=2..n):
    seq(T(n), n=2..40);  # Alois P. Heinz, Jan 09 2025
  • Mathematica
    Table[Select[Prime@ Range@ PrimePi@ n, PrimeQ[2 n - #] &], {n, 2, 30}] // Flatten (* Michael De Vlieger, May 14 2016 *)
    T[n_] := Table[If[PrimeQ[p] && PrimeQ[2n-p], p, Nothing], {p, 2, n}];
    Table[T[n], {n, 2, 30}] // Flatten (* Jean-François Alcover, Jan 09 2025, after Alois P. Heinz in A182138 *)

Formula

T(n,i) = n - A182138(n,i). - Jason Kimberley, Sep 25 2012
Showing 1-10 of 12 results. Next