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.

Previous Showing 11-13 of 13 results.

A138885 n-th run has length n-th nonprime number, with digits 0 and 1 only, starting with 1.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Omar E. Pol, Apr 06 2008

Keywords

Examples

			.n ..... Run ................... Length
.1 ..... 1 ..................... 1
.2 ..... 0,0,0,0 ............... 4
.3 ..... 1,1,1,1,1,1 ........... 6
.4 ..... 0,0,0,0,0,0,0,0 ....... 8
.5 ..... 1,1,1,1,1,1,1,1,1 ..... 9
		

Crossrefs

Programs

  • Mathematica
    Join[{1},{PadRight[{},#[[1]],0],PadRight[{},#[[2]],1]}&/@Partition[Select[Range[ 20],CompositeQ],2]]//Flatten (* Harvey P. Dale, May 26 2023 *)

A138886 n-th run has length n-th nonprime number A018252, with digits 0 and 1 only, starting with 0.

Original entry on oeis.org

0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Omar E. Pol, Apr 06 2008

Keywords

Comments

Also the n-th run has length A141468, with digits 0 and 1 only, starting with 1.

Examples

			.n ..... Run ................... Length
.1 ..... 0 ..................... 1
.2 ..... 1,1,1,1 ............... 4
.3 ..... 0,0,0,0,0,0 ........... 6
.4 ..... 1,1,1,1,1,1,1,1 ....... 8
.5 ..... 0,0,0,0,0,0,0,0,0 ..... 9
		

Crossrefs

A211197 Table T(n,k) = 2*n + ((-1)^n)*(1/2 - (k-1) mod 2) - 1/2; n, k > 0, read by antidiagonals.

Original entry on oeis.org

1, 2, 4, 1, 3, 5, 2, 4, 6, 8, 1, 3, 5, 7, 9, 2, 4, 6, 8, 10, 12, 1, 3, 5, 7, 9, 11, 13, 2, 4, 6, 8, 10, 12, 14, 16, 1, 3, 5, 7, 9, 11, 13, 15, 17, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22
Offset: 1

Views

Author

Boris Putievskiy, Feb 03 2013

Keywords

Comments

In general, let B and C be sequences. By b(n) and c(n) denote elements B and C respectively. Table T(n,k) = (1-(-1)^k)*b(n)/2+(1+(-1)^k)*c(n)/2 read by antidiagonals.
For this sequence b(n)=2*n-1, b(n)=A005408(n), c(n)=2*n, c(n)=A005843(n).
If n is odd row T(n,k) is alternation b(n) and c(n) starts from b(n).
If n is even row T(n,k) is alternation c(n) and b(n) starts from c(n).
For this sequence if n is odd alternation numbers 2*n-1 and 2*n starts from 2*n-1.
For this sequence if n is even alternation numbers 2*n and 2*n-1 starts from 2*n.
T(n,k) is replication of the first and the second columns that are “a braid” from sequences B and C.

Examples

			The start of the sequence as table for general case:
  b(1)..c(1)..b(1)..c(1)..b(1)..c(1)..b(1)..c(1)..
  c(2)..b(2)..c(2)..b(2)..c(2)..b(2)..c(2)..b(2)..
  b(3)..c(3)..b(3)..c(3)..b(3)..c(3)..b(3)..c(3)..
  c(4)..b(4)..c(4)..b(4)..c(4)..b(4)..c(4)..b(4)..
  b(5)..c(5)..b(5)..c(5)..b(5)..c(5)..b(5)..c(5)..
  c(6)..b(6)..c(6)..b(6)..c(6)..b(6)..c(6)..b(6)..
  b(7)..c(7)..b(7)..c(7)..b(7)..c(7)..b(7)..c(7)..
  c(8)..b(8)..c(8)..b(8)..c(8)..b(8)..c(8)..b(8)..
  . . .
The start of the sequence as triangle array read by rows for general case:
  b(1);
  c(1),c(2);
  b(1),b(2),b(3);
  c(1),c(2),c(3),c(4);
  b(1),b(2),b(3),b(4),b(5);
  c(1),c(2),c(3),c(4),c(5),c(6);
  b(1),b(2),b(3),b(4),b(5),b(6),b(7);
  c(1),c(2),c(3),c(4),c(5),c(6),c(7),c(8);
. . .
Row number r contains r numbers.
If r is odd  b(1),b(2),...,b(r).
If r is even c(1),c(2),...,c(r).
The start of the sequence as table for b(n)=2*n-1 and c(n)=2*n:
  1....2...1...2...1...2...1...2...
  4....3...4...3...4...3...4...3...
  5....6...5...6...5...6...5...6...
  8....7...8...7...8...7...8...7...
  9...10...9..10...9..10...9..10...
  12..11..12..11..12..11..12..11...
  13..14..13..14..13..14..13..14...
  16..15..16..15..16..15..16..15...
  . . .
The start of the sequence as triangle array read by rows for  b(n)=2*n-1 and c(n)=2*n:
  1;
  2,4;
  1,3,5;
  2,4,6,8;
  1,3,5,7,9;
  2,4,6,8,10,12;
  1,3,5,7,9,11,13;
  2,4,6,8,10,12,14,16;
  . . .
Row number r contains r numbers.
If r is odd  1,3,...2*r-1 - coincides with the elements row number r triangle array read by rows for sequence 2*A002260-1.
If r is even 2,4,...,2*r  - coincides with the elements row number r triangle array read by rows for sequence 2*A002260.
		

Crossrefs

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result =2*i+((-1)**i)*(0.5 - (j-1) % 2) - 0.5
    
  • Python
    a211197_list = [2*n - k%2 for k in range(1, 13) for n in range(1, k+1)] # David Radcliffe, Jun 01 2025

Formula

For the general case:
As a table: T(n,k) = (1-(-1)^k)*b(n)/2+(1+(-1)^k)*c(n)/2.
As a linear sequence: a(n) = (1-(-1)^j)*b(i)/2+(1+(-1)^j)*c(i)/2, where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2).
where b(n) = 2*n-1 and c(n) = 2*n.
As a table: T(n,k) = 2*n+((-1)^n)*(1/2- (k-1) mod 2) - 1/2.
As a linear sequence:
a(n) = 2*A002260(n) + ((-1)^A002260(n))*(1/2- (A004736(n)-1) mod 2) -1/2.
a(n) = -(1+(-1)^A003056(n))*A002260(n) +(1+(-1)^A003056(n))*(2*A002260(n)-1)/2.
a(n) = 2*i+((-1)^i)*(1/2- (j-1) mod 2) - 1/2
a(n) = -(1+(-1)^t)*i +(1+(-1)^t)*(2*i-1)/2,
where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2).
T(n, k) = 2*n - 1 + (n+k mod 2); a(n) = 2*A002260(n) - A057211(n). - David Radcliffe, Jun 01 2025
Previous Showing 11-13 of 13 results.