OFFSET
1,2
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..9119
EXAMPLE
Start with 1, then as 2 is bigger than 1, 1 * 2 = 2. As n=3 is bigger than 2, 2 * 3 = 6. As n=4 is smaller than 6, 6 - 4 = 2, then 2 * 5 = 10, then 10 - 6 = 4, then 4 * 7 = 28, etc
MAPLE
A200044 := proc(n)
option remember;
if n = 1 then
1;
elif n >= procname(n-1) then
n*procname(n-1) ;
else
procname(n-1)-n ;
end if;
end proc:
seq(A200044(n), n=1..80) ; # R. J. Mathar, Jan 28 2012
MATHEMATICA
a = {1}; Do[AppendTo[a, If[a[[-1]] <= n, a[[-1]]*n, a[[-1]] - n]], {n, 2, 52}]; a (* Ivan Neretin, May 20 2015 *)
nxt[{n_, a_}]:={n+1, If[n+1>=a, a(n+1), a-n-1]}; NestList[nxt, {1, 1}, 60][[All, 2]] (* Harvey P. Dale, Oct 20 2016 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Rodolfo Kurchan, Nov 12 2011
STATUS
approved