OFFSET
1,1
LINKS
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-1] and a[s-1]>a[s] then pk:=[op(pk), a[s-1]]; fi;
od:
a; # A285200
pk; # A285203
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 02 2017
STATUS
approved