OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..2000
EXAMPLE
a(5) = 5 plus the maximum of {1*2,2*5} = 5+10=15.
a(6) = 6 plus the maximum of {1*15,2*9,5*5} = 6+25=31.
MAPLE
A054253 := proc(n) local i, j; option remember; if n<=2 then n else j := 0; 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; end if; end proc;
# second Maple program:
a:= proc(n) option remember; n +`if`(n>2,
max(seq(a(i)*a(n-i), i=1..n/2)), 0)
end:
seq(a(n), n=1..42); # Alois P. Heinz, Apr 03 2020
MATHEMATICA
a[n_] := a[n] = If[n <= 2, n, n + Max[a[#] a[n-#]& /@ Range[n-1]]];
Array[a, 33] (* Jean-François Alcover, Apr 03 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 04 2000
EXTENSIONS
More specific name and examples from M. F. Hasler, Dec 08 2009 and R. J. Mathar, Dec 09 2009
STATUS
approved