A286282 Stage at which Ken Knowlton's elevator (version 2) reaches floor n for the first time.
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
Keywords
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..400
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.
Comments