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.

A138585 The sequence is formed by concatenating subsequences S1, S2, ... each of finite length. S1 consists of the element 1. The n-th subsequence consist of numbers {(n/2)*(n/2 - 1)+ 1, ..., (n/2)*(n/2 + 1)} for n even, {((n-1)/2)^2, ..., (n-1)/2 * ((n-1)/2 + 2)} for n odd.

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, May 13 2008

Keywords

Comments

A generalized Connell sequence.
Except for the first term the first element of each subsequence Sn (equivalently, each row of the triangle) gives A004652 (offset by 1), and the last element is A035106.

Examples

			S1: {1}
S2: {1,2}
S3: {1,2,3,}
S4: {3,4,5,6}
S5: {4,5,6,7,8}
S6: {7,8,9,10,11,12}, etc.
so concatenation of S1/S2/S3/S4/S5/S6/... gives:
1,1,2,1,2,3,3,4,5,6,4,5,6,7,8,7,8,9,10,11,12,...
		

Crossrefs

Cf. A001614.

Programs

  • Maple
    S := proc(n) local s: if(n=1)then s:=1: elif(n mod 2 = 0)then s:=(n/2)*(n/2 -1)+1: else s:=((n-1)/2)^2: fi: seq(k,k=s..s+n-1): end: seq(S(n),n=1..12); # Nathaniel Johnston, Oct 01 2011

Extensions

Corrected and edited by D. S. McNeil, Dec 12 2010