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) |

|
(2) |
> |
# Unfortunalely Maple fails to find all the solutions; eq must be simplified first!
|

|
(3) |

|
(4) |

|
(5) |
> |
remove(u ->(eval(a,u)<=0 or eval(b,u)<=0),[s]);
|
![[{a = 673, b = 1358114}, {a = 674, b = 340033}, {a = 1009, b = 2018}, {a = 2018, b = 1009}, {a = 340033, b = 674}, {a = 1358114, b = 673}]](/view.aspx?sf=209928_post/1fad6345c4afb1ec59f286a4802e757f.gif)
|
(6) |
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)]:
|
> |
k:=nops(P): s:=add(P):
numsols:=0:
|
> |
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) |
|
Download putnam2018.mw
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