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.

A194258 Second inverse function (numbers of columns) for pairing function A060734.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Dec 21 2012

Keywords

Comments

The sequence is the first inverse function (numbers of rows) for pairing function A060736.

Examples

			The start of the sequence as triangle array read by rows:
1;
1,2,2;
1,2,3,3,3;
1,2,3,4,4,4,4;
. . .
Row number k contains 2k-1 numbers 1,2,...k-1,k,k,...k (k times repetition "k").
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Join[Range[n-1],Table[n,{n}]],{n,10}]] (* Harvey P. Dale, Jun 23 2013 *)
  • Python
    t=int(math.sqrt(n-1)) +1
    j=min(t,n-(t-1)**2)

Formula

a(n) = min{t; n - (t - 1)^2}, where t=floor(sqrt(n-1))+1.