A200044 Starting with a(1)=1, a(n) = n*a(n-1) if n>= a(n-1), otherwise a(n) = a(n-1)-n.
1, 2, 6, 2, 10, 4, 28, 20, 11, 1, 11, 132, 119, 105, 90, 74, 57, 39, 20, 400, 379, 357, 334, 310, 285, 259, 232, 204, 175, 145, 114, 82, 49, 15, 525, 489, 452, 414, 375, 335, 294, 252, 209, 165, 120, 74, 27, 1296, 1247, 1197, 1146, 1094
Offset: 1
Examples
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
Links
- Ivan Neretin, Table of n, a(n) for n = 1..9119
Programs
-
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 *)