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

A285203 Local high points in A285200.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 02 2017

Keywords

Crossrefs

Programs

  • Maple
    hit:=Array(1..50,0);
    hit[1]:=1; a:=[1]; dir:=1; f:=1; pk:=[];
    for s from 2 to 900 do
    if dir>0 then f:=f+1; else f:=f-1; fi;
    hit[f]:=hit[f]+1; a:=[op(a),f];
    if (hit[f] mod f) = 0 then dir:=1; else dir:=-1; fi;
    if s>2 and a[s-2]a[s] then pk:=[op(pk),a[s-1]]; fi;
    od:
    a; # A285200
    pk; # A285203

A285202 A285200 displayed as an irregular triangle read by rows.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 03 2017

Keywords

Comments

This is Ken Knowlton's elevator sequence A285200, but with an extra 1 each time the elevator returns to (or starts at) the first floor.
Row lengths are A285204. The row maxima are given in A285203 (for n>0).

Examples

			Triangle begins:
1,
1, 2, 1,
1, 2, 3, 2, 1,
1, 2, 3, 2, 1,
1, 2, 3, 4, 3, 2, 1,
1, 2, 3, 2, 1,
1, 2, 3, 4, 3, 2, 1,
1, 2, 3, 2, 1,
1, 2, 3, 4, 3, 2, 1,
1, 2, 3, 2, 1,
1, 2, 3, 4, 5, 4, 3, 2, 1,
...
		

Crossrefs

A285201 Stage at which Ken Knowlton's elevator (version 1) reaches floor n for the first time.

Original entry on oeis.org

1, 2, 5, 14, 45, 174, 825, 4738, 32137, 251338, 2224157, 21952358, 238962581, 2843085270, 36696680241, 510647009850, 7619901954001, 121367981060434, 2055085325869813, 36861997532438654, 698193329457246653, 13924819967953406654, 291683979376372766697, 6402385486361598687666, 146948520147021794869977
Offset: 1

Views

Author

R. L. Graham, May 02 2017

Keywords

Comments

Indices of records in A285200.
When prefixed by a(0)=0, the first differences give A111063. - N. J. A. Sloane, May 03 2017

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, n, ((n-1)^2*a(n-1)
          -(n-2)*(2*n-3)*a(n-2)+(n-1)*(n-3)*a(n-3))/(n-2))
        end:
    seq(a(n), n=1..25);  # Alois P. Heinz, Jul 11 2018
  • Mathematica
    a[n_] := 2 - n + 2 Sum[k!/j!, {k, 0, n-2}, {j, 0, k}];
    Array[a, 25] (* Jean-François Alcover, Nov 01 2020 *)

Formula

a(n) = 2 - n + 2 * Sum_{k=0..n-2} Sum_{j=0..k} k!/j!.
For n >= 2, a(n) = 1+n+2*Sum_{k=2..n} C(n,k)*(k-1)! = 1+n+2*n!*Sum_{k=2..n} 1/(k*(n-k)!). - N. J. A. Sloane, May 03 2017
E.g.f.: exp(x)*(1-x-2*log(1-x)). Omitting the factor exp(x), this gives (essentially) the e.g.f. for A098558 (or A052849). - N. J. A. Sloane, May 03 2017

A286281 a(n) = floor the elevator is on at the n-th stage of Ken Knowlton's elevator problem, version 2.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 09 2017

Keywords

Comments

An elevator steps up or down a floor at a time. It starts at floor 1, and always goes up from floor 1. From each floor m, it steps up every m-th time it stops there (except that stops when the elevator is going down don't count), otherwise down.

References

  • Ken Knowlton, Email to R. L. Graham and N. J. A. Sloane, May 04 2017

Crossrefs

For records see A286282.
See A285200 for the first version of the elevator problem.

Programs

  • Maple
    hit:=Array(1..50, 0);
    hit[1]:=1; a:=[1]; dir:=1; f:=1;
    for s from 2 to 1000 do
    if dir>0 or f=1 then f:=f+1; hit[f]:=hit[f]+1; dir:=1; else f:=f-1; dir:=-1; fi;
    a:=[op(a), f];
    if (dir=1) and ((hit[f] mod f) = 0) then dir:=1; else dir:=-1; fi;
    od:
    a;
  • Mathematica
    f[n_, m_: 20] := Block[{a = {}, r = ConstantArray[0, m], f = 1, d = 0}, Do[AppendTo[a, f]; If[d == 1, r = MapAt[# + 1 &, r, f]]; If[Or[And[ Divisible[r[[f]], f], d == 1], f == 1], f++; d = 1, f--; d = -1], {i, n}]; a]; f@ 100 (* Michael De Vlieger, May 10 2017 *)

A285204 Row lengths of triangle A285202.

Original entry on oeis.org

1, 3, 5, 5, 7, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 11, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 11, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 9, 5, 7, 5, 7, 5, 11, 5, 7, 5, 7, 5, 9, 5, 7
Offset: 0

Views

Author

N. J. A. Sloane, May 03 2017

Keywords

Crossrefs

Formula

a(n) = 2*A285203(n)-1 for n>0.
Showing 1-5 of 5 results.