

A282442


a(n) is the smallest step size that does not occur on a staircase of n steps when following the following procedure: Take steps of length 1 up a staircase until you can't step any further, then take steps of length 2 down until you can't step any further, and so on.


8



2, 3, 3, 4, 6, 5, 5, 9, 9, 8, 10, 11, 11, 15, 15, 11, 12, 18, 19, 16, 20, 17, 15, 24, 25, 18, 20, 28, 19, 24, 26, 21, 21, 31, 31, 20, 28, 25, 21, 32, 40, 33, 31, 39, 39, 25, 25, 35, 35, 51, 47, 32, 40, 54, 55, 48, 50, 41, 39, 60, 59, 58, 63, 59, 49, 50, 58
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

a(n) <= n + 1.
From the Mathematics Stack Exchange question:
Assume there are n stairs (so n+1 places to stand).
Starting from the bottom, go up 1 stair at a time, until you reach the top;
then turn around and go down 2 stairs at a time, until you can't go further;
then turn around and go up 3 stairs at a time, until you can't go further;
then 4, 5, 6, etc. stairs at a time, until you can't even make one step.


LINKS

Peter Kagey, Table of n, a(n) for n = 1..10000
Sheljohn, A curious sequence, Mathematics Stack Exchange, Feb 15 2017


EXAMPLE

For n = 4:
step size 1: 0 > 1 > 2 > 3 > 4;
step size 2: 4 > 2 > 0;
step size 3: 0 > 3.
Because the walker cannot take four steps down, a(4) = 4.


MAPLE

A282442 := proc(n)
local h, dir, ss, ns;
h := 0 ;
dir := 1 ;
for ss from 1 do
if dir > 0 then
ns := floor((nh)/ss) ;
else
ns := floor(h/ss) ;
end if;
if ns = 0 then
return ss;
end if;
h := h+dir*ns*ss ;
dir := dir ;
end do:
end proc:
seq(A282442(n), n=1..100) ; # R. J. Mathar, Feb 25 2017


CROSSREFS

Sequence in context: A159999 A003977 A003971 * A200668 A200469 A200251
Adjacent sequences: A282439 A282440 A282441 * A282443 A282444 A282445


KEYWORD

nonn,look


AUTHOR

Peter Kagey, Feb 15 2017


STATUS

approved



