A285200 a(n) = floor the elevator is on at the n-th stage of Ken Knowlton's elevator problem, version 1.
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
Keywords
References
- Ken Knowlton, Email to R. L. Graham, Apr 26 2017
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..20000
- Ken Knowlton, Illustration showing what floor the elevator is on for the first 49 stages
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;
Comments