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.

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 02 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, otherwise down.
See A285202 for an alternative way to display this sequence.

References

  • Ken Knowlton, Email to R. L. Graham, Apr 26 2017

Crossrefs

See A286281 for a second 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 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;
    od:
    a;

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

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

Original entry on oeis.org

1, 2, 5, 18, 79, 408, 2469, 17314, 138555, 1247052, 12470593, 137176614, 1646119479, 21399553360, 299593747197, 4493906208138, 71902499330419, 1222342488617364, 22002164795112825, 418041131107143982, 8360822622142879983, 175577275065000480024, 3862700051430010560949
Offset: 1

Views

Author

N. J. A. Sloane, May 09 2017

Keywords

Comments

Indices of records in A286281.
Theorem: Let b(n) = Sum_{k=0..n} n!/k! = A000522(n). Then a(n) = 2*b(n-1)-n+2-2*(n-1)!. - R. L. Graham, May 10 2017
This implies the following recurrence (conjectured by N. J. A. Sloane on May 09 2017): a(1)=1, and for n>=1, a(n+1) = n*a(n) + n^2 - 3*n + 3. From the asymptotic expansion of b(n) (see A000522), we have a(n) ~ 2*(e-1)*(n-1)!.

Crossrefs

Programs

  • Maple
    A286282 := proc(n)
        2*A002627(n-1)-n+2 ;
    end proc:
    seq(A286282(n),n=1..21) ; # R. J. Mathar, May 21 2017
  • 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]; Rest@ Map[First, Values@ PositionIndex@ FoldList[Max, 0, f@ 200000]] - 1 (* Michael De Vlieger, May 10 2017, Version 10 *)
  • Python
    times = {1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 11: 1, 12: 1, 13: 1, 14: 1, 15: 1, 16: 1}
    first = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0, 10: 0, 11: 0, 12: 0, 13: 0, 14: 0, 15: 0, 16: 0}
    floor = 1
    steps = 1
    while floor < 17:
        if first[floor] == 0:
            first[floor] = 1
            print("First Time: ",floor,steps)
        if floor == 1:
            floor += 1
        else:
            if times[floor] < floor:
                times[floor] += 1
                floor -= 1
            else:
                times[floor] = 0
                floor += 1
        steps += 1
    print(floor, steps)
    # David Consiglio, Jr., May 09 2017

Formula

a(n) = 2*A002627(n-1) - (n-2). - N. J. A. Sloane, May 15 2017
Conjecture: a(n) +(-n-2)*a(n-1) +3*(n-1)*a(n-2) +(-3*n+8)*a(n-3) +(n-4)*a(n-4)=0. - R. J. Mathar, May 21 2017
Conjecture: (n+1)*a(n) +(-n^2+3*n-27)*a(n-1) +3*(-n^2+10*n-13)*a(n-2) +(n-3)*(4*n-17)*a(n-3)=0. - R. J. Mathar, May 21 2017

Extensions

a(10)-a(13) from David Consiglio, Jr., May 09 2017
Further terms added by N. J. A. Sloane, May 10 2017 based on R. L. Graham's formula.

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

A360830 Numbers that when concatenated with the natural numbers from 1 to N are divisible by the corresponding order number.

Original entry on oeis.org

1, 3, 6, 42, 84, 252, 2772, 36036, 612612, 11639628, 267711444, 803134332, 23290895628, 722017764468, 1444035528936, 53429314570632, 2190601897395912, 94195881588024216, 4427206434637138152, 30990445042459967064
Offset: 1

Views

Author

Rodolfo Kurchan, Feb 22 2023

Keywords

Comments

There is an elevator with the numbers from 1 to N. Each number goes up in the elevator and can go up as long as the concatenation of this number with the number of the floor (1 to N) is a multiple of the floor.
Example, the number 1 reaches floor 2, because 11 is divisible by 1, 12 is divisible by 2, but it does not reach floor 3 because 13 is not divisible by 3.
The sequence shows the numbers that can go higher in the elevator than the previous number.
For example, 2 cannot go higher than 1, so it does not appear, instead number 3 can go up to floor 3, since 31 is divisible by 1, 32 is divisible by 2 and 33 is divisible by 3, instead I couldn't get to floor 4 because 34 is not divisible by 4.

Examples

			42 goes after 6, because it is the smallest number that can go more than the 6th floor that can go number 6. 421, 422, 423, 424, 425, 426 and 427 are divisible by 1, 2, 3, 4, 5, 6 and 7, but 42 cannot go to floor 8th, because 428 it is not divisible by 8.
   n |         a(n)         | Maximum Elevator floor
  ---------------------------------------------------
   1 |                    1 |          2
   2 |                    3 |          3
   3 |                    6 |          6
   4 |                   42 |          7
   5 |                   84 |          8
   6 |                  252 |         10
   7 |                 2772 |         12
   8 |                36036 |         16
   9 |               612612 |         18
  10 |             11639628 |         22
  11 |            267711444 |         26
  12 |            803134332 |         28
  13 |          23290895628 |         30
  14 |         722017764468 |         31
  15 |        1444035528936 |         36
  16 |       53429314570632 |         40
  17 |     2190601897395912 |         42
  18 |    94195881588024216 |         46
  19 |  4427206434637138152 |         48
  20 | 30990445042459967064 |         52
  ...
		

References

  • Jaime Poniachik, Problem El Ascensor, La Odisea del Ingenio, May 1990.

Crossrefs

Showing 1-5 of 5 results.