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

A256262 Number of successive odd numbers that are not twin primes and number of successive twin primes, interleaved.

Original entry on oeis.org

1, 3, 1, 2, 1, 2, 4, 2, 4, 2, 7, 2, 4, 2, 13, 2, 1, 2, 13, 2, 4, 2, 13, 2, 4, 2, 1, 2, 13, 2, 4, 2, 13, 2, 4, 2, 13, 2, 16, 2, 34, 2, 4, 2, 13, 2, 28, 2, 22, 2, 13, 2, 7, 2, 10, 2, 7, 2, 73, 2, 4, 2, 1, 2, 13, 2, 10, 2, 67, 2, 4, 2, 7, 2, 4, 2, 13, 2, 28, 2
Offset: 1

Views

Author

Omar E. Pol, Mar 31 2015

Keywords

Comments

See also both A256252 and A256253 which contain similar diagrams.

Examples

			Consider an irregular array in which the odd-indexed rows list successive odd numbers that are not twin primes (A255763) and the even-indexed rows list successive twin primes (A001097), in the sequence of odd numbers (A005408), as shown below:
1;
3, 5, 7;
9;
11, 13;
15;
17; 19;
21, 23, 25, 27;
39, 31;
...
a(n) is the length of the n-th row.
.
Illustration of the first 16 regions of the diagram of the symmetric representation of odd numbers that are not twin primes (A255763) and of twin primes (A001097).
.            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |   31
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _  | |   29
.           | | | | |_ _ _ _ _ _ _ _ _  | | |   19
.           | | | | |_ _ _ _ _ _ _ _  | | | |   17
.           | | | | | |_ _ _ _ _ _  | | | | |   13
.           | | | | | |_ _ _ _ _  | | | | | |   11
.           | | | | | | |_ _ _  | | | | | | |    7
.           | | | | | | |_ _  | | | | | | | |    5
.   A255763 | | | | | | |_  | | | | | | | | |    3
.      1    | | | | | | |_|_|_|_| | | | | | | A001097
.      9    | | | | | |_ _ _ _ _|_|_| | | | |
.     15    | | | | |_ _ _ _ _ _ _ _|_|_| | |
.     21    | | | |_ _ _ _ _ _ _ _ _ _ _| | |
.     23    | | |_ _ _ _ _ _ _ _ _ _ _ _| | |
.     25    | |_ _ _ _ _ _ _ _ _ _ _ _ _| | |
.     27    |_ _ _ _ _ _ _ _ _ _ _ _ _ _|_|_|
.
a(n) is also the length of the n-th boundary segment in the zig-zag path of the above diagram, between the two types of numbers, as shown below for n = 1..8:
.
.                         |_ _ _
.                               |_ _
.                                   |_ _
.                                       |
.                                       |
.                                       |
.                                       |_ _
.
The sequence begins:      1,3,1,2,1,2,4,2,...
.
		

Crossrefs

Programs

  • PARI
    istwin(n) = isprime(n) && (isprime(n-2) || isprime(n+2));
    lista(nn) = {my(nb = 1, istp = 0); forstep (n=3, nn, 2, if (bitxor(istp, ! istwin(n)), nb++, print1(nb, ", "); nb = 1; istp = ! istp););} \\ Michel Marcus, May 25 2015

Extensions

More terms from Michel Marcus, May 25 2015

A256252 Number of successive odd noncomposite numbers A006005 and number of successive odd composite numbers A071904, interleaved.

Original entry on oeis.org

4, 1, 2, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 2, 1, 3, 1, 1, 2, 1, 2, 1, 1, 6, 1, 1, 1, 2, 2, 4, 2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 4, 2, 1, 2, 5, 1, 5, 1, 1, 2, 1, 1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 4, 1, 6, 1, 1, 2, 1, 1, 6, 1, 2, 1, 4, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2
Offset: 1

Views

Author

Omar E. Pol, Mar 30 2015

Keywords

Comments

See also A256253 and A256262 which contain similar diagrams.

Examples

			Consider an irregular array in which the odd-indexed rows list successive odd noncomposite numbers (A006005) and the even-indexed rows list successive odd composite numbers (A071904), in the sequence of odd numbers (A005408), as shown below:
1, 3, 5, 7;
9;
11, 13;
15;
17; 19;
21,
23;
25, 27;
39, 31;
...
a(n) is the length of the n-th row.
.
Illustration of the first 16 regions of the diagram of the symmetric representation of odd noncomposite numbers A006005 and odd composite numbers A071904:
.            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |   31
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _  | |   29
.           | | |_ _ _ _ _ _ _ _ _ _ _  | | |   23
.           | | | |_ _ _ _ _ _ _ _ _  | | | |   19
.           | | | |_ _ _ _ _ _ _ _  | | | | |   17
.           | | | | |_ _ _ _ _ _  | | | | | |   13
.           | | | | |_ _ _ _ _  | | | | | | |   11
.           | | | | | |_ _ _  | | | | | | | |    7
.           | | | | | |_ _  | | | | | | | | |    5
.           | | | | | |_  | | | | | | | | | |    3
.   A071904 | | | | | |_|_|_|_| | | | | | | |    1
.      9    | | | | |_ _ _ _ _|_|_| | | | | | A006005
.     15    | | | |_ _ _ _ _ _ _ _|_|_| | | |
.     21    | | |_ _ _ _ _ _ _ _ _ _ _|_| | |
.     25    | |_ _ _ _ _ _ _ _ _ _ _ _ _| | |
.     27    |_ _ _ _ _ _ _ _ _ _ _ _ _ _|_|_|
.
a(n) is also the length of the n-th boundary segment in the zig-zag path of the above diagram, between the two types of numbers, as shown below for n = 1..9:
.                      _ _ _ _
.                             |_ _
.                                 |_ _
.                                     |_
.                                       |
.                                       |_ _
.
The sequence begins:      4,1,2,1,2,1,1,2,2,...
.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(nb = 1, isc = 0); forstep (n=3, nn, 2, if (bitxor(isc, isprime(n)), nb++, print1(nb, ", "); nb = 1; isc = ! isc););} \\ Michel Marcus, May 25 2015

Formula

a(n) = A256253(n+1), n >= 2.

A256134 The absolute value of a(n) is the length of the n-th line segment of a labyrinth related to odd nonprimes (A014076) and odd primes (A065091) (see Comments lines for definition).

Original entry on oeis.org

1, 1, 1, -1, -2, -2, 1, 3, 4, 4, 5, 5, 5, -1, -6, -7, -7, -8, -8, -8, 1, 9, 10, 10, 11, 11, 12, 12, 12, -1, -13, -14, -14, -14, 1, 15, 16, 16, 16, -1, -17, -18, -18, -19, -19, -20, -20, -20, 1, 21, 22, 22, 23, 23, 24, 24, 24, -1, -25, -26, -26, -27, -27, -27, 1, 28, 29, 29, 29, -1, -30, -31, -31, -31, 1, 32, 33, 33, 34
Offset: 1

Views

Author

Omar E. Pol, Mar 31 2015

Keywords

Comments

In order to construct this sequence we use the following rules:
We start with the diagram described in A256253 in which the regions in direction S-W represent the odd nonprimes (A014076) and the regions in direction N-E represent the odd primes (A065091).
The diagram must be modified such that the new diagram contains only one region of infinite length as shown in Example section, figure 1.
The absolute value of a(n) is the length of the n-th line segment in the walk into the mentioned diagram as shown in Example section, figure 2.
The sign of a(n) is the same as the sign of the precedent term in the sequence whose absolute value is 1.
The positive value of a(n) means that the line segment rotates in the direction of the clockwise.
The negative value of a(n) means that the line segment rotates counter to the clockwise.
A line segment of length x can be replaced be x toothpicks with nodes between their endpoints.
Also the sequence can be interpreted as an irregular array T(j,k), see Formula section and Example section.

Examples

			Written as an irregular array T(j,k) the sequence begins:
  -----------------------
   j/k:     1    2    3
  -----------------------
   1:                 1;
   2:       1,   1,  -1;
   3:      -2,  -2,   1;
   4:       3,   4;
   5:       4,   5;
   6:       5,   5,  -1;
   7:      -6,  -7;
   8:      -7,  -8;
   9:      -8,  -8,   1;
  10:       9,  10;
  11:      10,  11;
  12:      11,  12;
  13:      12,  12,  -1;
  14:     -13, -14;
  15:     -14, -14,   1;
  16:      15,  16;
  17:      16,  16;  -1;
  18:     -17, -18;
  19:     -18, -19:
  20:     -19, -20;
  ...
.           _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.          |  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |   37
.          | |   |  _ _ _ _ _ _ _ _ _ _ _ _ _ _  | |   31
.          | | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _  | | |   29
.          | | | |   |  _ _ _ _ _ _ _ _ _ _  | | | |   23
.          | | | | | | |  _ _ _ _ _ _ _ _  | | | | |   19
.          | | | | | | |_ _ _ _ _ _ _ _  | | | | | |   17
.          | | | | | | |  _ _ _ _ _ _  | | | | | | |   13
.          | | | | | | | |  _ _ _ _  | | | | | | | |   11
.          | | | | | | | | |  _ _  | | | | | | | | |    7
.          | | | | | | | | |_ _  | | | | | | | | | |    5
.  A014076 | | | | | | | | |   | | | | | | | | | | |    3
.     1    | | | | | | | | |_|_ _| | | | | | | | | | A065091
.     9    | | | | | | | |_ _ _ _ _|_ _| | | | | | |
.    15    | | | | | | |_ _ _ _ _ _ _ _ _| | | | | |
.    21    | | | | | |_ _ _ _ _ _ _ _ _ _ _| | | | |
.    25    | | | | |_ _ _ _ _ _ _ _ _ _ _ _ _| | | |
.    27    | | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
.    33    | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| |
.    35    | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
.    39    |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.
Figure 1. Here the diagram described in A256253 was modified such that the new diagram contains only one region of infinite length.
.
Illustration of initial terms (n = 1..46):
.            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.           |  _   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |
.           | | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _  | |
.           | | |  _   _ _ _ _ _ _ _ _ _ _ _  | | |
.           | | | | | |  _ _ _ _ _ _ _ _ _  | | | |
.           | | | | | | |_ _ _ _ _ _ _ _  | | | | |
.           | | | | | |  _ _ _ _ _ _ _  | | | | | |
.           | | | | | | |  _ _ _ _ _  | | | | | | |
.           | | | | | | | |  _ _ _  | | | | | | | |
.           | | | | | | | | |_ _  | | | | | | | | |
.           | | | | | | | |  _  | | | | | | | | | |
.           | | | | | | | | | |_| | | | | | | | | |
.           | | | | | | | |_ _ _ _| |_| | | | | | |
.           | | | | | | |_ _ _ _ _ _ _ _| | | | | |
.           | | | | | |_ _ _ _ _ _ _ _ _ _| | | | |
.           | | | | |_ _ _ _ _ _ _ _ _ _ _ _| | | |
.           | | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
.           | | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| |
.           | |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|       Labyrinth
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  <-- entrance
.
Figure 2. Interpreted as a sequence, the absolute value of a(n) is the length of the n-th line segment starting from the center of the structure. The figure shows the first 46 line segments. Note that the structure looks like a labyrinth.
		

Crossrefs

Formula

Written as an irregular array we have that:
T(1,3) = 1.
And for j > 1:
T(j,1) = m*(j-1), where m is the precedent term in the sequence whose absolute value is 1.
T(j,2) = T(j,1), if 2*j-1 is an odd prime and 2*j+1 is an odd nonprime or if 2*j-1 is an odd nonprime and 2*j+1 is an odd prime.
T(j,3) = (-1)*m, if T(j,1) = T(j,2), where m is the precedent term in the sequence whose absolute value is 1, otherwise T(j,3) does not exist.
Showing 1-3 of 3 results.