OFFSET
0,3
EXAMPLE
a(3)=8 since the following 4-tuples of function values (f(0),f(1),f(2),f(3)) and no others, have the required properties: (0,0,0,0), (0,1,1,0), (0,1,2,0), (0,2,1,0), (0,2,2,0), (0,2,3,0), (0,3,2,0) and (0,3,3,0).
PROG
(Pascal)
program concave1;
var n:integer;
function f(y0, x1, y1, n:integer): longint;
var y, ymax:integer; ct:longint;
begin
if n=0 then begin f := 1; exit; end;
if x1=n-1 then begin f := 1; exit; end;
ct := 0;
if x1=0 then ymax := n else ymax := 2*y1-y0;
if ymax>n then ymax := n;
for y := y1-(y1 div (n-x1)) to ymax do
ct := ct+f(y1, x1+1, y, n);
f := ct;
end;
begin
for n := 0 to 30 do
write(f(0, 0, 0, n):10);
readln;
end.
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Mar 28 2002
EXTENSIONS
More terms from Sean A. Irvine, Feb 27 2024
STATUS
approved