#
#	Q(n) : number of multiplications for Strassen algorithm
#	A(n): number of additions (idem)
#	AQ(n): multiplications and additions
#
Q := proc(n)
option remember;
if n<2 then n else
	7*Q(iquo(n+1,2));
	if " > n**3 then
		print(`For n=`, n, `direct application is better`);
		n**3
		fi;
	"
	fi
end:
A := proc(n)
option remember;
if n<2 then 0 else
	7*A(iquo(n+1,2)) + 15*iquo(n+1,2)**2;
	if " > n**2*(n-1) then
		print(`For n=`, n, `direct application is better`);
		n**2*(n-1)
		fi;
	"
	fi
end:
AQ := proc(n)
option remember;
if n<2 then n else
	6*AQ(iquo(n+1,2)) + 15*iquo(n+1,2)**2 + AQ(iquo(n,2));
	if " > n**2*(2*n-1) then
		print(`For n=`, n, `direct application is better`);
		n**2*(2*n-1)
		fi;
	"
	fi
end:
