#Ok to post #Salman Manzoor, 03-16-25, Assignment 15 # for odd n, the largest must be at an even position, as every odd position other than the last has a number greater succeeding it and the last must be less than the second to last (n>=2) # for even n, the largest cannot be first as second could not be greater. For any other odd position, the preceding would have to be greater, so largest must be at an even position UDc:=proc(n) option remember: local k,bound: with(combinat): if evalb(n=1 or n=2) then RETURN(1): fi: bound:=trunc(n/2): add(binomial(n-1,2*k-1)* UDc(2*k-1)* UDc(n-2*k),k=1..bound): end: