:

## Putnam Mathematical Competition 2018

Maple

Maple can solve the easiest two problems of the Putnam Mathematical Competition 2018.  link

Problem A1

Find all ordered pairs (a,b) of positive integers for which  1/a + 1/b = 3/2018

 > eq:= 1/a + 1/b = 3/2018;
 (1)
 > isolve(%);
 (2)
 > # Unfortunalely Maple fails to find all the solutions; eq must be simplified first!
 > (lhs-rhs)(eq);
 (3)
 > numer(%);
 (4)
 > s:=isolve(%);
 (5)
 > remove(u ->(eval(a,u)<=0 or eval(b,u)<=0),[s]);
 (6)
 > # Now it's OK.

Problem B1

Consider the set of  vectors  P = { < a, b> :  0 ≤ a ≤ 2, 0 ≤ b ≤ 100, a, b in Z}.
Find all v in P such that the set P \ {v} can be partitioned into two sets of equal size and equal sum.

 > n:=100: P:= [seq(seq([a,b],a=0..2), b=0..n)]:
 > for i to k do   v:=P[i]; sv:=s-v;   if irem(sv[1],2)=1 or irem(sv[2],2)=1 then next fi;   cond:=simplify(add( x[j]*~P[j],j=1..k))-sv/2;   try     sol:=[];     sol:=Optimization:-Minimize          (0, {x[i]=0, (cond=~0)[], add(x[i],i=1..k)=(k-1)/2 }, assume=binary);     catch:   end try:   if sol<>[] then numsols:=numsols+1;      print(v='P'[i], select(j -> (eval(x[j],sol[2])=1), {seq(1..k)})) fi; od: 'numsols'=numsols;
 (7)
 >

Edit.
Maple can be also very useful in solving the difficult problem B6; it can be reduced to compute the (huge) coefficient of x^1842 in the polynomial

g := (1 + x + x^2 + x^3 + x^4 + x^5 + x^9)^2018;

The computation is very fast:

coeff(g, x, 1842):   evalf(%);

0.8048091229e1147

﻿