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

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

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

Original entry on oeis.org

1, 2, 3, 3, 5, 3, 7, 5, 7, 3, 11, 3, 5, 11, 13, 5, 7, 11, 13, 3, 7, 13, 17, 3, 5, 17, 19, 5, 7, 11, 13, 17, 19, 3, 7, 19, 23, 5, 11, 17, 23, 7, 11, 13, 17, 19, 23, 3, 13, 19, 29, 3, 5, 11, 23, 29, 31, 5, 7, 13, 17, 19, 23, 29, 31, 7, 31, 3, 11, 17
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 >= 4. - Nathaniel Johnston, Apr 18 2011

Examples

			Triangle begins:
                          1
                          2
                          3
                       3, .  5
                    3, .  .  .  7
                 .  .  5, .  7, . .
              3, .  .  .  .  .  .  . 11
           3, .  5, .  .  .  .  . 11, . 13
        .  .  5, .  7, .  .  . 11, . 13, .  .
     3, .  .  .  7, .  .  .  .  . 13, .  .  . 17
		

Crossrefs

Programs

  • Maple
    print(1):print(2):print(3):for n from 1 to 15 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):fi:od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    Table[n + Union@ Join[#, -#] /. {} -> {n} &@ Select[DeleteCases[n - Prime@ Range[2, PrimePi@ n], 0], AllTrue[n + # {-1, 1}, PrimeQ] &], {n, 20}] // Flatten (* Michael De Vlieger, Feb 03 2019 *)

Extensions

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

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

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

A154784 Row sums of triangle in A154721.

Original entry on oeis.org

0, 4, 6, 16, 10, 24, 28, 32, 54, 60, 44, 96, 52, 56, 120, 96, 102, 144, 76, 120, 210, 176, 138, 288, 200, 156, 324, 168, 174, 420, 186, 320, 396, 204, 350, 504, 370, 380, 546, 400, 328, 756, 344, 352, 900, 368, 376, 672, 392, 600
Offset: 1

Views

Author

Omar E. Pol, Jan 15 2009

Keywords

Comments

a(n) is even for all n.

Crossrefs

Programs

  • Maple
    isnotcomp:=proc(n)return (n=1 or isprime(n)) end:
    for n from 1 to 50 do rsum:=0: for k from 1 to 2*n-1 do if(not k=n and (isnotcomp(k) and isnotcomp(2*n-k)))then rsum:=rsum+k:fi:od: printf("%d, ",rsum):od: # Nathaniel Johnston, Apr 19 2011

Formula

a(n) = A154783(n) - n.

Extensions

Edited by Omar E. Pol, Jan 17 2009
a(11)-a(50) from Nathaniel Johnston, Apr 19 2011

A154804 Number of ways to represent 2*n as the sum of two distinct primes (counting 1 as a prime).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Jan 16 2009

Keywords

Comments

Number of ways to represent 2*n as the sum of two distinct noncomposite numbers. - Omar E. Pol, Dec 11 2024

Crossrefs

Formula

a(n) = A101264(n-1) + A061357(n). [From R. J. Mathar, Jan 21 2009]
a(n) = A001031(n) - A080339(n).

Extensions

More terms from R. J. Mathar, Jan 21 2009
Edited by Franklin T. Adams-Watters, Jan 31 2009

A154791 Triangle read by rows in which row n lists all the pairs of noncomposite numbers that are equidistant from n, with 0's inserted, as shown below in the example.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Jan 25 2009

Keywords

Examples

			Triangle begins:
n ....... Pairs
1 ..........0
2 ........ 1,3
3 ....... 1,0,5
4 ...... 1,3,5,7
5 ..... 0,3,0,7,0
6 .... 1,0,5,7,0,11
		

Crossrefs

Programs

  • PARI
    iscomp(n) = (n!=1) && !isprime(n);
    vecp(n) = {v = vector(n, i, 2*i-1); for (i = 1, n\2, if (iscomp(v[i]) || iscomp(v[n-i+1]), v[i] = 0; v[n-i+1] = 0);); if ((n % 2), v[n\2+1] = 0); v;}
    trgp(nn) = {for (n = 1, nn, v = vecp(n); for (k = 1, n, print1(v[k], ", ");); print(););} \\ Michel Marcus, Feb 13 2014

Extensions

More terms from Michel Marcus, Feb 13 2014
Showing 1-10 of 12 results. Next