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.

A220280 The reluctant sequence for A002260.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 3, 1, 1, 1, 2, 1, 2, 3, 1, 2, 1, 1, 2, 1, 2, 3, 1, 2, 3, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3
Offset: 1

Views

Author

Boris Putievskiy, Dec 12 2012

Keywords

Comments

The reluctant sequence B for a sequence A is a triangular array in which row k (>= 1) consists of the first k terms of A.
Here A002260 is the reluctant sequence for the sequence 1,2,3,... of positive numbers (A000027).

Examples

			A002260 begins
  1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, ...
so the first few rows of the new triangle are
   1,
   1, 1,
   1, 1, 2,
   1, 1, 2, 1,
   1, 1, 2, 1, 2,
   1, 1, 2, 1, 2, 3,
   ...
                                                                               ~
		

Crossrefs

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    n1=n-t*(t+1)/2
    t1=int((math.sqrt(8*n1-7) - 1)/ 2)
    a=n1-t1*(t1+1)/2

Formula

a(n) = n1 - t1(t1+1)/2, where n1 = n - t(t+1)/2, t1 = floor[(-1+sqrt(8*n1-7))/2], t=floor[(-1+sqrt(8*n-7))/2]. For example, a(6)=2 since t=2, t1=1, n1=3.

Extensions

Edited by N. J. A. Sloane, Jun 07 2024