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.

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

This page as a plain text file.
%I A285200 #20 May 09 2017 15:18:23
%S A285200 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,
%T A285200 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,
%U A285200 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
%N A285200 a(n) = floor the elevator is on at the n-th stage of Ken Knowlton's elevator problem, version 1.
%C A285200 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.
%C A285200 See A285202 for an alternative way to display this sequence.
%D A285200 Ken Knowlton, Email to R. L. Graham, Apr 26 2017
%H A285200 N. J. A. Sloane, <a href="/A285200/b285200.txt">Table of n, a(n) for n = 1..20000</a>
%H A285200 Ken Knowlton, <a href="/A285200/a285200.png">Illustration showing what floor the elevator is on for the first 49 stages</a>
%p A285200 hit:=Array(1..50,0);
%p A285200 hit[1]:=1; a:=[1]; dir:=1; f:=1;
%p A285200 for s from 2 to 1000 do
%p A285200 if dir>0 then f:=f+1; else f:=f-1; fi;
%p A285200 hit[f]:=hit[f]+1; a:=[op(a),f];
%p A285200 if (hit[f] mod f) = 0 then dir:=1; else dir:=-1; fi;
%p A285200 od:
%p A285200 a;
%Y A285200 Cf. A285201, A285202, A285203.
%Y A285200 See A286281 for a second version of the elevator problem.
%K A285200 nonn
%O A285200 1,2
%A A285200 _N. J. A. Sloane_, May 02 2017