OFFSET
0,3
COMMENTS
If in the Maple code "if n<=2 then n" were replaced by "if n<=1 then n", then the sequence would become the triangular numbers A000217. In general, if the Maple code were "if n<=k then n" for some given k > 0 then a(n) would be n if n <= k, n + k*(n-k) if k <= n <= 2k and n*(n+1)/2 - k*(k-1) if 2k <= n. - Henry Bottomley, Mar 30 2001
LINKS
FORMULA
For n > 4: a(n) = a(n-1) + n.
G.f.: x*(x^2-x+1)*(x^3-x^2-1)/(x-1)^3. - R. J. Mathar, Dec 09 2009
EXAMPLE
a(3) = 3 + 1*2 = 5,
a(4) = 4 + 2*2 = 8 since 2*2 < 1*5,
a(5) = 5 + 1*8 = 13 since 1*8 < 2*5.
MAPLE
A054254 := proc(n) local i, j; option remember; if n<=2 then n else j := 10^100; for i from 1 to n-1 do if procname(i)*procname(n-i) < j then j := procname(i)*procname(n-i); end if; end do; n+j; fi; end proc;
MATHEMATICA
Join[{0, 1, 2, 5}, LinearRecurrence[{3, -3, 1}, {8, 13, 19}, 50]] (* Jean-François Alcover, Apr 29 2023 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 04 2000
EXTENSIONS
More specific name from R. J. Mathar, Dec 09 2009
STATUS
approved