MaplePrimes Posts

MaplePrimes Posts are for sharing your experiences, techniques and opinions about Maple, MapleSim and related products, as well as general interests in math and computing.

Latest Post
  • Latest Posts Feed
  • Exact solutions for PDE and Boundary / Initial Conditions

     

    Significant developments happened during 2018 in Maple's ability for the exact solving of PDE with Boundary / Initial conditions. This is work in collaboration with Katherina von Bülow. Part of these developments were mentioned in previous posts.  The project is still active but it's December, time to summarize.

     

    First of all thanks to all of you who provided feedback. The new functionality is described below, in 11 brief Sections, with 30 selected examples and a few comments. A worksheet with this contents is linked at the end of this post. Some of these improvements appeared first in 2018.1, then in 2018.2, but other ones are posterior. To reproduce the input/output below in Maple 2018.2.1, the latest Maplesoft Physics Updates (version 269 or higher) needs to be installed.

     

    1. PDE and BC problems solved using linear change of variables

     

    PDE and BC problems often require that the boundary and initial conditions be given at certain evaluation points (usually in which one of the variables is equal to zero). Using linear changes of variables, however, it is possible to change the evaluation points of BC, obtaining the solution for the new variables, and then changing back to the original variables. This is now automatically done by the pdsolve command.

     

    Example 1: A heat PDE & BC problem in a semi-infinite domain:

    pde__1 := diff(u(x, t), t) = (1/4)*(diff(u(x, t), x, x))

    iv__1 := u(-A, t) = 0, u(x, B) = 10

     

    Note the evaluation points A and B. The method typically described in textbooks requires the evaluation points to be A = 0, B = 0. The change of variables automatically used in this case is:

    transformation := {t = tau+B, x = xi-A, u(x, t) = upsilon(xi, tau)}

    {t = tau+B, x = xi-A, u(x, t) = upsilon(xi, tau)}

    (1)

    so that pdsolve's task becomes solving this other problem, now with the appropriate evaluation points

    PDEtools:-dchange(transformation, [pde__1, iv__1], {tau, upsilon, xi})

    [diff(upsilon(xi, tau), tau) = (1/4)*(diff(diff(upsilon(xi, tau), xi), xi)), upsilon(0, tau) = 0, upsilon(xi, 0) = 10]

    (2)

    and then changing the variables back to the original {x, t, u} and giving the solution. The process all in one go:

    `assuming`([pdsolve([pde__1, iv__1])], [abs(A) < x, abs(B) < t])

    u(x, t) = 10*erf((x+A)/(t-B)^(1/2))

    (3)

     

    Example 2: A heat PDE with a source and a piecewise initial condition

    pde__2 := diff(u(x, t), t)+1 = mu*(diff(u(x, t), x, x))

    iv__2 := u(x, 1) = piecewise(0 <= x, 0, x < 0, 1)

    `assuming`([pdsolve([pde__2, iv__2])], [0 < mu, 0 < t])

    u(x, t) = 3/2-(1/2)*erf((1/2)*x/(mu^(1/2)*(t-1)^(1/2)))-t

    (4)

     

    Example 3: A wave PDE & BC problem in a semi-infinite domain:

    pde__3 := diff(u(x, t), t, t) = diff(u(x, t), x, x)

    iv__3 := u(x, 1) = exp(-(x-6)^2)+exp(-(x+6)^2), (D[2](u))(x, 1) = 1/2

    `assuming`([pdsolve([pde__3, iv__3])], [0 < t])

    u(x, t) = (1/2)*exp(-(-x+t+5)^2)+(1/2)*exp(-(-x+t-7)^2)+(1/2)*exp(-(x+t-7)^2)+(1/2)*exp(-(x+t+5)^2)+(1/2)*t-1/2

    (5)

     

    Example 4: A wave PDE & BC problem in a semi-infinite domain:

    pde__4 := diff(u(x, t), t, t)-(1/4)*(diff(u(x, t), x, x)) = 0

    iv__4 := (D[1](u))(1, t) = 0, u(x, 0) = exp(-x^2), (D[2](u))(x, 0) = 0

    `assuming`([pdsolve([pde__4, iv__4])], [1 < x, 0 < t])

    u(x, t) = piecewise((1/2)*t < x-1, (1/2)*exp(-(1/4)*(t+2*x)^2)+(1/2)*exp(-(1/4)*(t-2*x)^2), x-1 < (1/2)*t, (1/2)*exp(-(1/4)*(t+2*x)^2)+(1/2)*exp(-(1/4)*(t-2*x+4)^2))

    (6)

     

    Example 5: A wave PDE with a source:

    pde__5 := diff(u(x, t), t, t)-c^2*(diff(u(x, t), x, x)) = f(x, t)

    iv__5 := u(x, 1) = g(x), (D[2](u))(x, 1) = h(x)

    pdsolve([pde__5, iv__5], u(x, t))

    u(x, t) = (1/2)*(Int(Int((diff(diff(h(zeta), zeta), zeta))*c^2*tau+(diff(diff(g(zeta), zeta), zeta))*c^2+f(zeta, tau+1), zeta = (-t+tau+1)*c+x .. x+c*(t-1-tau)), tau = 0 .. t-1)+(2*t-2)*c*h(x)+2*g(x)*c)/c

    (7)

    pdetest(u(x, t) = (1/2)*(Int(Int((diff(diff(h(zeta), zeta), zeta))*c^2*tau+(diff(diff(g(zeta), zeta), zeta))*c^2+f(zeta, tau+1), zeta = (-t+tau+1)*c+x .. x+c*(t-1-tau)), tau = 0 .. t-1)+(2*t-2)*c*h(x)+2*g(x)*c)/c, [pde__5, iv__5])

    [0, 0, 0]

    (8)

    2. It is now possible to specify or exclude method(s) for solving

     

    The pdsolve/BC solving methods can now be indicated, either to be used for solving, as in methods = [method__1, method__2, () .. ()] to be tried in the indicated order, or to be excluded, as in exclude = [method__1, method__2, () .. ()]. The methods and sub-methods available are organized in a table,
    `pdsolve/BC/methods`

    indices(`pdsolve/BC/methods`)

    [1], [2], [3], [2, "Series"], [2, "Heat"], ["high_order"], ["system"], [2, "Wave"], [2, "SpecializeArbitraryFunctions"]

    (9)


    So, for example, the methods for PDEs of first order and second order are, respectively,

    `pdsolve/BC/methods`[1]

    ["SpecializeArbitraryFunctions", "Fourier", "Laplace", "Generic", "PolynomialSolutions", "LinearDifferentialOperator"]

    (10)

    `pdsolve/BC/methods`[2]

    ["SpecializeArbitraryFunctions", "SpecializeArbitraryConstants", "Wave", "Heat", "Series", "Laplace", "Fourier", "Generic", "PolynomialSolutions", "LinearDifferentialOperator", "Superposition"]

    (11)

     

    Some methods have sub-methods (their existence is visible in (9)):

    `pdsolve/BC/methods`[2, "Series"]

    ["ThreeBCsincos", "FourBC", "ThreeBC", "ThreeBCPeriodic", "WithSourceTerm", "ThreeVariables"]

    (12)

    `pdsolve/BC/methods`[2, "Heat"]

    ["SemiInfiniteDomain", "WithSourceTerm"]

    (13)

     

    Example 6:

    pde__6 := diff(u(r, theta), r, r)+diff(u(r, theta), theta, theta) = 0

    iv__6 := u(2, theta) = 3*sin(2*theta)+1

    pdsolve([pde__6, iv__6])

    u(r, theta) = -_F2(-I*r+2*I+theta)+1-3*sin((2*I)*r-4*I-2*theta)+_F2(I*r-2*I+theta)

    (14)

    pdsolve([pde__6, iv__6], method = Fourier)

    u(r, theta) = ((3/2)*I)*exp(2*r-4-(2*I)*theta)-((3/2)*I)*exp(-2*r+4+(2*I)*theta)+1

    (15)

    Example 7:

    pde__7 := diff(u(x, y), x, x)+diff(u(x, y), y, y) = 0

    iv__7 := u(x, 0) = Dirac(x)

    pdsolve([pde__7, iv__7])

    u(x, y) = Dirac(x)-(1/2)*Dirac(2, x)*y^2+_C3*y

    (16)

    pdsolve([pde__7, iv__7], method = Fourier)

    u(x, y) = invfourier(exp(-s*y), s, x)

    (17)

    convert(u(x, y) = invfourier(exp(-s*y), s, x), Int)

    u(x, y) = (1/2)*(Int(exp(-s*y+I*s*x), s = -infinity .. infinity))/Pi

    (18)

    pdsolve([pde__7, iv__7], method = Generic)

    u(x, y) = -_F2(-y+I*x)+Dirac(x+I*y)+_F2(y+I*x)

    (19)

    3. Series solutions for linear PDE and BC problems solved via product separation with eigenvalues that are the roots of algebraic expressions which cannot be inverted

     

    Linear problems for which the PDE can be separated by product, giving rise to Sturm-Liouville problems for the separation constant (eigenvalue) and separated functions (eigenfunctions), do not always result in solvable equations for the eigenvalues. Below are examples where the eigenvalues are respectively roots of a sum of  BesselJ functions and of the non-inversible equation tan(lambda[n])+lambda[n] = 0.

     

    Example 8: This problem represents the temperature distribution in a thin circular plate whose lateral surfaces are insulated (Articolo example 6.9.2):

    pde__8 := diff(u(r, theta, t), t) = (diff(u(r, theta, t), r)+r*(diff(u(r, theta, t), r, r))+(diff(u(r, theta, t), theta, theta))/r)/(25*r)

    iv__8 := (D[1](u))(1, theta, t) = 0, u(r, 0, t) = 0, u(r, Pi, t) = 0, u(r, theta, 0) = (r-(1/3)*r^3)*sin(theta)

    pdsolve([pde__8, iv__8])

    u(r, theta, t) = `casesplit/ans`(Sum(-(4/3)*BesselJ(1, lambda[n]*r)*sin(theta)*exp(-(1/25)*lambda[n]^2*t)*(BesselJ(0, lambda[n])*lambda[n]^3-BesselJ(1, lambda[n])*lambda[n]^2+4*lambda[n]*BesselJ(0, lambda[n])-8*BesselJ(1, lambda[n]))/(lambda[n]^3*(BesselJ(0, lambda[n])^2*lambda[n]+BesselJ(1, lambda[n])^2*lambda[n]-2*BesselJ(0, lambda[n])*BesselJ(1, lambda[n]))), n = 0 .. infinity), {And(-BesselJ(1, lambda[n])+BesselJ(2, lambda[n])*lambda[n] = 0, 0 < lambda[n])})

    (20)

     

    In the above we see that the eigenvalue `&lambda;__n` satisfies -BesselJ(1, lambda[n])+BesselJ(2, lambda[n])*lambda[n] = 0. When `&lambda;__n` is the root of one single BesselJ or BesselY function of integer order, the Maple functions BesselJZeros and BesselYZeros are used instead. That is the case, for instance, if we slightly modify this problem changing the first boundary condition to be u(1, theta, t) = 0 instead of (D[1](u))(1, theta, t) = 0

    `iv__8.1` := u(1, theta, t) = 0, u(r, 0, t) = 0, u(r, Pi, t) = 0, u(r, theta, 0) = (r-(1/3)*r^3)*sin(theta)

    pdsolve([pde__8, `iv__8.1`])

    u(r, theta, t) = `casesplit/ans`(Sum(-(4/3)*BesselJ(1, lambda[n]*r)*sin(theta)*exp(-(1/25)*lambda[n]^2*t)*(lambda[n]^2+4)/(BesselJ(0, lambda[n])*lambda[n]^3), n = 1 .. infinity), {And(lambda[n] = BesselJZeros(1, n), 0 < lambda[n])})

    (21)

    Example 9: This problem represents the temperature distribution in a thin rod whose left end is held at a fixed temperature of 5 and whose right end loses heat by convection into a medium whose temperature is 10. There is also an internal heat source term in the PDE (Articolo's textbook, example 8.4.3):

    pde__9 := diff(u(x, t), t) = (1/20)*(diff(u(x, t), x, x))+t

    iv__9 := u(0, t) = 5, u(1, t)+(D[1](u))(1, t) = 10, u(x, 0) = -40*x^2*(1/3)+45*x*(1/2)+5

    pdsolve([pde__9, iv__9], u(x, t))

    u(x, t) = `casesplit/ans`(Sum(piecewise(lambda[n] = 0, 0, (80/3)*exp(-(1/20)*lambda[n]^2*t)*sin(lambda[n]*x)*(lambda[n]^2*cos(lambda[n])+lambda[n]*sin(lambda[n])+4*cos(lambda[n])-4)/(lambda[n]^2*(sin(2*lambda[n])-2*lambda[n]))), n = 0 .. infinity)+Int(Sum(piecewise(lambda[n] = 0, 0, 4*exp(-(1/20)*lambda[n]^2*(t-tau))*sin(lambda[n]*x)*tau*(cos(lambda[n])-1)/(sin(2*lambda[n])-2*lambda[n])), n = 0 .. infinity), tau = 0 .. t)+(5/2)*x+5, {And(tan(lambda[n])+lambda[n] = 0, 0 < lambda[n])})

    (22)

    For information on how to test or plot a solution like the one above, please see the end of the Mapleprimes post "Sturm-Liouville problem with eigenvalues that are the roots of algebraic expressions which cannot be inverted" 

     

    4. Superposition method for linear PDE with more than one non-homogeneous BC

     

    Previously, for linear homogeneous PDE problems with non-periodic initial and boundary conditions, pdsolve was only consistently able to solve the problem as long as at most one of those conditions was non-homogeneous. The superposition method works by taking advantage of the linearity of the problem and the fact that the solution to such a problem in which two or more of the BC are non-homogeneous can be given as

    u = u__1+u__2 + ...,  where each u__i is a solution of the PDE with all but one of the BC homogenized.

     

    Example 10: A Laplace PDE with one homogeneous and three non-homogeneous conditions:

    pde__10 := diff(u(x, y), x, x)+diff(u(x, y), y, y) = 0

    iv__10 := u(0, y) = 0, u(Pi, y) = sinh(Pi)*cos(y), u(x, 0) = sin(x), u(x, Pi) = -sinh(x)

    pdsolve([pde__10, iv__10])

    u(x, y) = ((exp(2*Pi)-1)*(Sum((-1)^n*n*(exp(2*Pi)-1)*exp(n*(Pi-y)-Pi)*sin(n*x)*(exp(2*n*y)-1)/(Pi*(n^2+1)*(exp(2*Pi*n)-1)), n = 1 .. infinity))+(exp(2*Pi)-1)*(Sum(2*sin(n*y)*exp(n*(Pi-x))*n*sinh(Pi)*((-1)^n+1)*(exp(2*n*x)-1)/(Pi*(exp(2*Pi*n)-1)*(n^2-1)), n = 2 .. infinity))+sin(x)*(exp(-y+2*Pi)-exp(y)))/(exp(2*Pi)-1)

    (23)

     

    5. Polynomial solutions method:

     

    This new method gives pdsolve better performance when the PDE & BC problems admit polynomial solutions.

     

    Example 11:

    pde__11 := diff(u(x, y), x, x)+y*(diff(u(x, y), y, y)) = 0

    iv__11 := u(x, 0) = 0, (D[2](u))(x, 0) = x^2

    pdsolve([pde__11, iv__11], u(x, y))

    u(x, y) = y*(x^2-y)

    (24)

     

    6. Solving more problems using the Laplace transform or the Fourier transform

     

    These methods now solve more problems and are no longer restricted to PDE of first or second order.

     

    Example 12: A third order PDE & BC problem:

    pde__12 := diff(u(x, t), t) = -(diff(u(x, t), x, x, x))

    iv__12 := u(x, 0) = f(x)

    pdsolve([pde__12, iv__12])

    u(x, t) = (1/4)*(Int((4/3)*Pi*f(-zeta)*(-(x+zeta)/(-t)^(1/3))^(1/2)*BesselK(1/3, -(2/9)*3^(1/2)*(x+zeta)*(-(x+zeta)/(-t)^(1/3))^(1/2)/(-t)^(1/3))/(-t)^(1/3), zeta = -infinity .. infinity))/Pi^2

    (25)

     

    Example 13: A PDE & BC problem that is solved using Laplace transform:

    pde__13 := diff(u(x, y), y, x) = sin(x)*sin(y)

    iv__13 := u(x, 0) = 1+cos(x), (D[2](u))(0, y) = -2*sin(y)

    pdsolve([pde__13, iv__13])

    u(x, y) = (1/2)*cos(x-y)+(1/2)*cos(x+y)+cos(y)

    (26)

    To see the computational flow, the solving methods used and in which order they are tried use

    infolevel[pdsolve] := 2

    2

    (27)

    Example 14:

    pde__14 := diff(u(x, y), x, x)+diff(u(x, y), y, y) = 0

    iv__14 := u(x, 0) = 0, u(x, b) = h(x)

    pdsolve([pde__14, iv__14])

    * trying method "SpecializeArbitraryFunctions" for 2nd order PDEs
       -> trying "LinearInXT"
       -> trying "HomogeneousBC"
    * trying method "SpecializeArbitraryConstants" for 2nd order PDEs
    * trying method "Wave" for 2nd order PDEs
       -> trying "Cauchy"
       -> trying "SemiInfiniteDomain"
       -> trying "WithSourceTerm"
    * trying method "Heat" for 2nd order PDEs
       -> trying "SemiInfiniteDomain"
       -> trying "WithSourceTerm"
    * trying method "Series" for 2nd order PDEs
       -> trying "ThreeBCsincos"
       -> trying "FourBC"
       -> trying "ThreeBC"
       -> trying "ThreeBCPeriodic"
       -> trying "WithSourceTerm"
          * trying method "SpecializeArbitraryFunctions" for 2nd order PDEs
             -> trying "LinearInXT"
             -> trying "HomogeneousBC"
                Trying travelling wave solutions as power series in tanh ...
                   Trying travelling wave solutions as power series in ln ...
          * trying method "SpecializeArbitraryConstants" for 2nd order PDEs
             Trying travelling wave solutions as power series in tanh ...
                Trying travelling wave solutions as power series in ln ...
          * trying method "Wave" for 2nd order PDEs
             -> trying "Cauchy"
             -> trying "SemiInfiniteDomain"
             -> trying "WithSourceTerm"
          * trying method "Heat" for 2nd order PDEs
             -> trying "SemiInfiniteDomain"
             -> trying "WithSourceTerm"
          * trying method "Series" for 2nd order PDEs
             -> trying "ThreeBCsincos"
             -> trying "FourBC"
             -> trying "ThreeBC"
             -> trying "ThreeBCPeriodic"
             -> trying "WithSourceTerm"
             -> trying "ThreeVariables"
          * trying method "Laplace" for 2nd order PDEs
             -> trying a Laplace transformation
          * trying method "Fourier" for 2nd order PDEs
             -> trying a fourier transformation

          * trying method "Generic" for 2nd order PDEs
             -> trying a solution in terms of arbitrary constants and functions to be adjusted to the given initial conditions
          * trying method "PolynomialSolutions" for 2nd order PDEs

          * trying method "LinearDifferentialOperator" for 2nd order PDEs
          * trying method "Superposition" for 2nd order PDEs
       -> trying "ThreeVariables"
    * trying method "Laplace" for 2nd order PDEs
       -> trying a Laplace transformation
    * trying method "Fourier" for 2nd order PDEs
       -> trying a fourier transformation

       <- fourier transformation successful
    <- method "Fourier" for 2nd order PDEs successful

     

    u(x, y) = invfourier(exp(s*(b+y))*fourier(h(x), x, s)/(exp(2*s*b)-1), s, x)-invfourier(exp(s*(b-y))*fourier(h(x), x, s)/(exp(2*s*b)-1), s, x)

    (28)

    convert(u(x, y) = invfourier(exp(s*(b+y))*fourier(h(x), x, s)/(exp(2*s*b)-1), s, x)-invfourier(exp(s*(b-y))*fourier(h(x), x, s)/(exp(2*s*b)-1), s, x), Int)

    u(x, y) = (1/2)*(Int((Int(h(x)*exp(-I*x*s), x = -infinity .. infinity))*exp(s*(b+y)+I*s*x)/(exp(2*s*b)-1), s = -infinity .. infinity))/Pi-(1/2)*(Int((Int(h(x)*exp(-I*x*s), x = -infinity .. infinity))*exp(s*(b-y)+I*s*x)/(exp(2*s*b)-1), s = -infinity .. infinity))/Pi

    (29)

    Reset the infolevel to avoid displaying the computational flow:

    infolevel[pdsolve] := 1

    7. Improvements to solving heat and wave PDE, with or without a source:

     

    Example 15: A heat PDE:

    pde__15 := diff(u(x, t), t) = 13*(diff(u(x, t), x, x))

    iv__15 := (D[1](u))(0, t) = 0, (D[1](u))(1, t) = 1, u(x, 0) = (1/2)*x^2+x

    pdsolve([pde__15, iv__15], u(x, t))

    u(x, t) = 1/2+Sum(2*cos(n*Pi*x)*exp(-13*Pi^2*n^2*t)*(-1+(-1)^n)/(Pi^2*n^2), n = 1 .. infinity)+13*t+(1/2)*x^2

    (30)

    To verify an infinite series solution such as this one you can first use pdetest

    pdetest(u(x, t) = 1/2+Sum(2*cos(n*Pi*x)*exp(-13*Pi^2*n^2*t)*(-1+(-1)^n)/(Pi^2*n^2), n = 1 .. infinity)+13*t+(1/2)*x^2, [pde__15, iv__15])

    [0, 0, 0, 1/2+Sum(2*cos(n*Pi*x)*(-1+(-1)^n)/(Pi^2*n^2), n = 1 .. infinity)-x]

    (31)

    To verify that the last condition, for u(x, 0) is satisfied, we plot the first 1000 terms of the series solution with t = 0 and make sure that it coincides with the plot of  the right-hand side of the initial condition u(x, 0) = (1/2)*x^2+x. Expected: the two plots superimpose each other

    plot([value(subs(t = 0, infinity = 1000, rhs(u(x, t) = 1/2+Sum(2*cos(n*Pi*x)*exp(-13*Pi^2*n^2*t)*(-1+(-1)^n)/(Pi^2*n^2), n = 1 .. infinity)+13*t+(1/2)*x^2))), (1/2)*x^2+x], x = 0 .. 1)

     

    Example 16: A heat PDE in a semi-bounded domain:

    pde__16 := diff(u(x, t), t) = (1/4)*(diff(u(x, t), x, x))

    iv__16 := (D[1](u))(alpha, t) = 0, u(x, beta) = 10*exp(-x^2)

    `assuming`([pdsolve([pde__16, iv__16], u(x, t))], [0 < x, 0 < t])

    u(x, t) = -5*exp(x^2/(-t+beta-1))*((erf(((t-beta-1)*alpha+x)/((t-beta+1)^(1/2)*(t-beta)^(1/2)))-1)*exp(4*alpha*(-x+alpha)/(-t+beta-1))+erf(((t-beta+1)*alpha-x)/((t-beta+1)^(1/2)*(t-beta)^(1/2)))-1)/(t-beta+1)^(1/2)

    (32)

     

    Example 17: A wave PDE in a semi-bounded domain:

    pde__17 := diff(u(x, t), t, t)-9*(diff(u(x, t), x, x)) = 0

    iv__17 := (D[1](u))(0, t) = 0, u(x, 0) = 0, (D[2](u))(x, 0) = x^3

    `assuming`([pdsolve([pde__17, iv__17])], [0 < x, 0 < t])

    u(x, t) = piecewise(3*t < x, 9*t^3*x+t*x^3, x < 3*t, (27/4)*t^4+(9/2)*t^2*x^2+(1/12)*x^4)

    (33)

     

    Example 18: A wave PDE with a source

    pde__18 := diff(u(x, t), t, t) = diff(u(x, t), x, x)+x*exp(-t)

    iv__18 := u(0, t) = 0, u(1, t) = 0, u(x, 0) = 0, (D[2](u))(x, 0) = 1

    pdsolve([pde__18, iv__18])

    u(x, t) = Sum(((-Pi^2*(-1)^n*n^2+Pi^2*n^2+2*(-1)^(n+1)+1)*cos(n*Pi*(t-x))-Pi*(-1)^n*n*sin(n*Pi*(t-x))+(Pi^2*(-1)^n*n^2-Pi^2*n^2+2*(-1)^n-1)*cos(n*Pi*(t+x))+Pi*n*(2*exp(-t)*(-1)^(n+1)*sin(n*Pi*x)+sin(n*Pi*(t+x))*(-1)^n))/(Pi^2*n^2*(Pi^2*n^2+1)), n = 1 .. infinity)

    (34)

     

    Example 19: Another wave PDE with a source

    pde__19 := diff(u(x, t), t, t) = 4*(diff(u(x, t), x, x))+(1+t)*x

    iv__19 := u(0, t) = 0, u(Pi, t) = sin(t), u(x, 0) = 0, (D[2](u))(x, 0) = 0

    pdsolve([pde__19, iv__19])

    u(x, t) = ((Sum(-2*((1/2)*cos(n*x-t)*n^3-(1/2)*cos(n*x+t)*n^3+((-2*n^4-(1/2)*Pi*n^2+(1/8)*Pi)*sin(2*n*t)+(t-cos(2*n*t)+1)*n*(n-1/2)*Pi*(n+1/2))*sin(n*x))*(-1)^n/(Pi*n^4*(4*n^2-1)), n = 1 .. infinity))*Pi+x*sin(t))/Pi

    (35)

    8. Improvements in series methods for Laplace PDE problems

     

    "  Example 20:A Laplace PDE with BC representing the inside of a quarter circle of radius 1. The solution we seek is bounded as r approaches 0:"

    pde__20 := diff(u(r, theta), r, r)+(diff(u(r, theta), r))/r+(diff(u(r, theta), theta, theta))/r^2 = 0

    iv__20 := u(r, 0) = 0, u(r, (1/2)*Pi) = 0, (D[1](u))(1, theta) = f(theta)

    `assuming`([pdsolve([pde__20, iv__20], u(r, theta), HINT = boundedseries(r = [0]))], [0 <= theta, theta <= (1/2)*Pi, 0 <= r, r <= 1])

    u(r, theta) = Sum(2*(Int(f(theta)*sin(2*n*theta), theta = 0 .. (1/2)*Pi))*r^(2*n)*sin(2*n*theta)/(Pi*n), n = 1 .. infinity)

    (36)

     

    Example 21: A Laplace PDE for which we seek a solution that remains bounded as y approaches infinity:

    pde__21 := diff(u(x, y), x, x)+diff(u(x, y), y, y) = 0

    iv__21 := u(0, y) = A, u(a, y) = 0, u(x, 0) = 0

    `assuming`([pdsolve([pde__21, iv__21], HINT = boundedseries(y = infinity))], [a > 0])

    u(x, y) = ((Sum(-2*A*sin(n*Pi*x/a)*exp(-n*Pi*y/a)/(n*Pi), n = 1 .. infinity))*a-A*(x-a))/a

    (37)

     

    9. Better simplification of answers:

     

     

    Example 22: For this wave PDE with a source term, pdsolve used to return a solution with uncomputed integrals:

    pde__22 := diff(u(x, t), t, t) = A*x+diff(u(x, t), x, x)

    iv__22 := u(0, t) = 0, u(1, t) = 0, u(x, 0) = 0, (D[2](u))(x, 0) = 0

    pdsolve([pde__22, iv__22], u(x, t))

    u(x, t) = Sum(2*(-1)^n*A*sin(n*Pi*x)*cos(n*Pi*t)/(n^3*Pi^3), n = 1 .. infinity)+(1/6)*(-x^3+x)*A

    (38)

     

    Example 23: A BC at x = infinityis now handled by pdsolve:

    pde__23 := diff(u(x, y), x, x)+diff(u(x, y), y, y) = 0

    iv__23 := u(0, y) = sin(y), u(x, 0) = 0, u(x, a) = 0, u(infinity, y) = 0

    `assuming`([pdsolve([pde__23, iv__23], u(x, y))], [0 < a])

    u(x, y) = Sum(2*piecewise(a = Pi*n, (1/2)*Pi*n, -Pi*(-1)^n*sin(a)*n*a/(Pi^2*n^2-a^2))*exp(-n*Pi*x/a)*sin(n*Pi*y/a)/a, n = 1 .. infinity)

    (39)

     

    Example 24: A reduced Helmholtz PDE in a square of side "Pi. "Previously, pdsolve returned a series starting at n = 0, when the limit of the n = 0 term is 0.

    pde__24 := diff(u(x, y), x, x)+diff(u(x, y), y, y)-k*u(x, y) = 0

    iv__24 := u(0, y) = 1, u(Pi, y) = 0, u(x, 0) = 0, u(x, Pi) = 0

    `assuming`([pdsolve([pde__24, iv__24], u(x, y))], [0 < k])

    u(x, y) = Sum(-2*sin(n*y)*(-1+(-1)^n)*(exp(-(-2*Pi+x)*(n^2+k)^(1/2))-exp((n^2+k)^(1/2)*x))/((exp(2*(n^2+k)^(1/2)*Pi)-1)*Pi*n), n = 1 .. infinity)

    (40)

     

    10. Linear differential operator: more solutions are now successfully computed

     

     

    Example 25:

    pde__25 := diff(w(x1, x2, x3, t), t) = diff(w(x1, x2, x3, t), x1, x1)+diff(w(x1, x2, x3, t), x2, x2)+diff(w(x1, x2, x3, t), x3, x3)

    iv__25 := w(x1, x2, x3, 1) = exp(a)*x1^2+x2*x3

    pdsolve([pde__25, iv__25])

    w(x1, x2, x3, t) = (x1^2+2*t-2)*exp(a)+x2*x3

    (41)

     

    Example 26:

    pde__26 := diff(w(x1, x2, x3, t), t)-(D[1, 2](w))(x1, x2, x3, t)-(D[1, 3](w))(x1, x2, x3, t)-(D[3, 3](w))(x1, x2, x3, t)+(D[2, 3](w))(x1, x2, x3, t) = 0

    iv__26 := w(x1, x2, x3, a) = exp(x1)+x2-3*x3

    pdsolve([pde__26, iv__26])

    w(x1, x2, x3, t) = exp(x1)+x2-3*x3

    (42)

     

    Example 27:

    pde__27 := diff(w(x1, x2, x3, t), t, t) = (D[1, 2](w))(x1, x2, x3, t)+(D[1, 3](w))(x1, x2, x3, t)+(D[3, 3](w))(x1, x2, x3, t)-(D[2, 3](w))(x1, x2, x3, t)

    iv__27 := w(x1, x2, x3, a) = x1^3*x2^2+x3, (D[4](w))(x1, x2, x3, a) = -x2*x3+x1

    pdsolve([pde__27, iv__27], w(x1, x2, x3, t))

    w(x1, x2, x3, t) = x1^3*x2^2+3*x2*(-t+a)^2*x1^2+(1/2)*(-t+a)*(a^3-3*a^2*t+3*a*t^2-t^3-2)*x1-(1/6)*a^3+(1/2)*a^2*t+(1/6)*(-3*t^2+6*x2*x3)*a+(1/6)*t^3-t*x2*x3+x3

    (43)

     

     

    11. More problems in 3 variables are now solved

     

     

    Example 28: A Schrödinger type PDE in two space dimensions, where Z is Planck's constant.

    pde__28 := I*`&hbar;`*(diff(f(x, y, t), t)) = -`&hbar;`^2*(diff(f(x, y, t), x, x)+diff(f(x, y, t), y, y))/(2*m)

    iv__28 := f(x, y, 0) = sqrt(2)*(sin(2*Pi*x)*sin(Pi*y)+sin(Pi*x)*sin(3*Pi*y)), f(0, y, t) = 0, f(1, y, t) = 0, f(x, 1, t) = 0, f(x, 0, t) = 0

    pdsolve([pde__28, iv__28], f(x, y, t))

    f(x, y, t) = 2^(1/2)*sin(Pi*x)*(2*exp(-((5/2)*I)*`&hbar;`*t*Pi^2/m)*cos(Pi*x)*sin(Pi*y)+exp(-(5*I)*`&hbar;`*t*Pi^2/m)*sin(3*Pi*y))

    (44)

     

    Example 29: This problem represents the temperature distribution in a thin rectangular plate whose lateral surfaces are insulated yet is losing heat by convection along the boundary x = 1, into a surrounding medium at temperature 0 (Articolo example 6.6.3):

    pde__29 := diff(u(x, y, t), t) = 1/50*(diff(u(x, y, t), x, x)+diff(u(x, y, t), y, y))

    iv__29 := (D[1](u))(0, y, t) = 0, (D[1](u))(1, y, t)+u(1, y, t) = 0, u(x, 0, t) = 0, u(x, 1, t) = 0, u(x, y, 0) = (1-(1/3)*x^2)*y*(1-y)

    `assuming`([pdsolve([pde__29, iv__29], u(x, y, t))], [0 <= x, x <= 1, 0 <= y, y <= 1])

    u(x, y, t) = `casesplit/ans`(Sum(Sum((32/3)*exp(-(1/50)*t*(Pi^2*n^2+lambda[n1]^2))*(-1+(-1)^n)*cos(lambda[n1]*x)*sin(n*Pi*y)*(-lambda[n1]^2*sin(lambda[n1])+lambda[n1]*cos(lambda[n1])-sin(lambda[n1]))/(Pi^3*n^3*lambda[n1]^2*(sin(2*lambda[n1])+2*lambda[n1])), n1 = 0 .. infinity), n = 1 .. infinity), {And(tan(lambda[n1])*lambda[n1]-1 = 0, 0 < lambda[n1])})

    (45)

     

    Articolo's Exercise 7.15, with 6 boundary/initial conditions, two for each variable

    pde__30 := diff(u(x, y, t), t, t) = 1/4*(diff(u(x, y, t), x, x)+diff(u(x, y, t), y, y))-(1/10)*(diff(u(x, y, t), t))

    iv__30 := (D[1](u))(0, y, t) = 0, (D[1](u))(1, y, t)+u(1, y, t) = 0, (D[2](u))(x, 0, t)-u(x, 0, t) = 0, (D[2](u))(x, 1, t) = 0, u(x, y, 0) = (1-(1/3)*x^2)*(1-(1/3)*(y-1)^2), (D[3](u))(x, y, 0) = 0

     

    This problem is tricky ... There are three independent variables, therefore two eigenvalues (constants that appear separating variables by product) in the Sturm-Liouville problem. But after solving the separated system and also for the eigenvalues, the second eigenvalue is equal to the first one, and in addition cannot be expressed in terms of known functions, because the equation it solves cannot be inverted.

     

    pdsolve([pde__30, iv__30])

    u(x, y, t) = `casesplit/ans`(Sum((1/6)*(lambda[n]^2*sin(lambda[n])-lambda[n]*cos(lambda[n])+sin(lambda[n]))*cos(lambda[n]*x)*(exp((1/10)*t*(-200*lambda[n]^2+1)^(1/2))*(-200*lambda[n]^2+1)^(1/2)+exp((1/10)*t*(-200*lambda[n]^2+1)^(1/2))+(-200*lambda[n]^2+1)^(1/2)-1)*exp(-(1/20)*t*((-200*lambda[n]^2+1)^(1/2)+1))*(cos(lambda[n]*y)*lambda[n]+sin(lambda[n]*y))*(6*lambda[n]^2*cos(lambda[n])^2+cos(lambda[n])^2-5*lambda[n]^2-1)/((-200*lambda[n]^2+1)^(1/2)*(-cos(lambda[n])^4+(lambda[n]*sin(lambda[n])-1)*cos(lambda[n])^3+(lambda[n]^2+lambda[n]*sin(lambda[n])+1)*cos(lambda[n])^2+(lambda[n]^2+2*lambda[n]*sin(lambda[n])+1)*cos(lambda[n])+lambda[n]*(lambda[n]+sin(lambda[n])))*lambda[n]^4*(cos(lambda[n])-1)), n = 0 .. infinity), {And(tan(lambda[n])*lambda[n]-1 = 0, 0 < lambda[n])})

    (46)

    ``

     


     

    Download PDE_and_BC_during_2018.mw

    Edgardo S. Cheb-Terrab
    Physics, Differential Equations and Mathematical Functions, Maplesoft

    Error when running 'm_model.m' to generate simulink function block when using 'Group all parameters into nested structure'. No errors when using 'Do not group parameters'.

    Error using m_fullSwing (line 125)
    Invalid setting in 'MapleSim_fullSwing/MapleSim_fullSwing/MapleSimParameters' for parameter 'Value'.
    Caused by:
        Error using m_fullSwing (line 125)
        Expression '[Param.Address.ArmPlane, Param.Address.ClubRelHand,  ... ]' for
        parameter 'Value' in 'MapleSim_fullSwing/MapleSim_fullSwing/MapleSimParameters' cannot be evaluated.
            Error using m_fullSwing (line 125)
            Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for
            mismatched delimiters.
     


    Mittag-Leffler function generall simulation for fractional calculus

    alpha := 1:

    beta := 1:

    f1 := sum(x^k/GAMMA(alpha*k+beta), k = 0 .. infinity)

    exp(x)

    (1)

    NULL

    NULL

    NULL

    plot(f1, x = 0 .. 1)

     

    ``


     

    Download Mitag-liffler_Function.mw

    Yesterday, I accidentally discovered a nasty bug in a fairly simple example:

    restart;
    Expr:=a*sin(x)+b*cos(x);
    maximize(Expr, x=0..2*Pi);
    minimize(Expr, x=0..2*Pi);
                                        

    I am sure the correct answers are  sqrt(a^2+b^2)  and  -sqrt(a^2+b^2)  for any real values  a  and  b .  It is easy to prove in many ways. The simplest method does not require any calculations and can be done in the mind. We will consider  Expr  as the scalar product (or the dot product) of two vectors  <a, b>  and  <sin(x), cos(x)>, one of which is a unit vector. Then it is obvious that the maximum of this scalar product is reached if the vectors are codirectional and equals to the length of the first vector, that is, sqrt(a^2+b^2).

    Bugs in these commands were noted by users and earlier (see search by keywords bug, maximize, minimize) but unfortunately are still not fixed. 

    The attached worksheet develops a procedure for extrapolating boundary data from a square to its interior.  Specifically, let's consider the square [−1,1]×[−1,1] and the continuous functions u1, u2, u3, u4 defined on its edges. The procedure constructs a continuous function u(x,y) in the interior of the square which matches the boundary data.

    The function u(x,y) is necessarily discontinuous at a corner if the boundary data of the edges meeting at that corner are inconsistent.  However, if the boundary data are consistent at all corners, then u(x,y) is continuous everywhere including the boundary.

    Here is what the extrapolating function looks like:

    proc (x, y) options operator, arrow; (1/2)*(1-y)*(u__1(x)-(1/2)*(1-x)*u__1(-1))+(1/2)*(x+1)*(u__2(y)-(1/2)*(1-y)*u__2(-1))+(1/2)*(y+1)*(u__3(x)-(1/2)*(x+1)*u__3(1))+(1/2)*(1-x)*(u__4(y)-(1/2)*(y+1)*u__4(1))+(1/4)*(u__1(-1)-u__4(-1))*(-x^2+1)*(1-y)/((x+1)^2+(y+1)^2)^(1/2)+(1/4)*(u__2(-1)-u__1(1))*(-y^2+1)*(x+1)/((y+1)^2+(1-x)^2)^(1/2)+(1/4)*(u__3(1)-u__2(1))*(-x^2+1)*(y+1)/((1-x)^2+(1-y)^2)^(1/2)+(1/4)*(u__4(1)-u__3(-1))*(-y^2+1)*(1-x)/((1-y)^2+(x+1)^2)^(1/2) end proc

     

    The worksheet Extrapolant.mw contains the details of the derivation, and an example.

    PS: A challenge.  Extend the result to 3D, that is, construct a function u(x,y,z) on the cube [−1,1]×[−1,1]×[−1,1] which matches prescribed functions on the cube's six faces.

     

    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/a+1/b = 3/2018

    (1)

    isolve(%);

    {a = 1358114, b = 673}

    (2)

    # Unfortunalely Maple fails to find all the solutions; eq must be simplified first!

    (lhs-rhs)(eq);

    1/a+1/b-3/2018

    (3)

    numer(%);

    -3*a*b+2018*a+2018*b

    (4)

    s:=isolve(%);

    {a = -678048, b = 672}, {a = 0, b = 0}, {a = 672, b = -678048}, {a = 673, b = 1358114}, {a = 674, b = 340033}, {a = 1009, b = 2018}, {a = 2018, b = 1009}, {a = 340033, b = 674}, {a = 1358114, b = 673}

    (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}]

    (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)]:

    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;

    [1, 0] = P[2], {5, 10, 13, 14, 16, 19, 21, 23, 24, 26, 28, 31, 32, 35, 36, 38, 40, 41, 43, 46, 47, 49, 52, 53, 55, 57, 59, 62, 64, 67, 69, 70, 73, 75, 76, 79, 81, 82, 85, 86, 88, 90, 92, 93, 94, 95, 97, 98, 99, 100, 102, 103, 106, 107, 109, 112, 113, 115, 118, 120, 121, 126, 128, 135, 138, 144, 150, 154, 159, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 216, 219, 222, 225, 228, 229, 230, 231, 235, 236, 237, 238, 240, 241, 242, 243, 246, 248, 252, 253, 254, 258, 260, 261, 264, 266, 267, 270, 273, 274, 275, 276, 279, 280, 284, 287}

     

    [1, 2] = P[8], {3, 7, 10, 13, 14, 16, 19, 21, 22, 25, 27, 28, 31, 32, 34, 36, 37, 40, 42, 44, 46, 48, 50, 52, 55, 58, 59, 61, 62, 64, 66, 69, 70, 73, 74, 76, 77, 81, 83, 85, 87, 88, 91, 93, 94, 97, 98, 100, 102, 104, 106, 108, 110, 112, 115, 117, 118, 121, 122, 124, 126, 132, 135, 139, 140, 141, 144, 151, 153, 159, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 220, 222, 223, 225, 229, 230, 231, 234, 236, 237, 238, 240, 241, 242, 243, 246, 249, 250, 252, 255, 257, 258, 259, 261, 263, 266, 267, 269, 273, 276, 279, 281, 282, 284}

     

    [1, 4] = P[14], {7, 10, 13, 15, 19, 21, 22, 24, 26, 28, 31, 32, 33, 37, 38, 40, 42, 44, 47, 48, 50, 52, 55, 56, 59, 60, 63, 64, 66, 68, 71, 72, 75, 76, 78, 81, 82, 87, 88, 90, 91, 94, 95, 96, 97, 100, 102, 103, 105, 106, 109, 110, 113, 114, 115, 116, 117, 118, 121, 122, 124, 127, 132, 135, 138, 142, 144, 145, 154, 156, 159, 160, 163, 165, 170, 171, 172, 176, 177, 178, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 216, 219, 220, 222, 225, 226, 228, 229, 231, 232, 234, 235, 237, 239, 240, 241, 244, 245, 247, 248, 250, 251, 253, 254, 255, 258, 261, 262, 264, 265, 267, 268, 270, 272, 273, 276, 284}

     

    [1, 6] = P[20], {10, 14, 15, 16, 19, 22, 24, 26, 28, 30, 31, 34, 35, 37, 40, 43, 44, 46, 47, 51, 52, 54, 56, 58, 60, 62, 65, 66, 68, 70, 73, 75, 76, 79, 82, 83, 84, 85, 86, 87, 88, 90, 93, 94, 96, 97, 99, 102, 103, 106, 107, 109, 110, 114, 116, 117, 120, 121, 123, 126, 127, 128, 129, 130, 135, 138, 142, 144, 147, 152, 153, 154, 156, 157, 162, 163, 172, 174, 177, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 228, 229, 233, 234, 235, 236, 237, 241, 242, 246, 248, 249, 250, 251, 252, 253, 255, 258, 259, 262, 263, 265, 267, 269, 270, 273, 275, 276}

     

    [1, 8] = P[26], {4, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 29, 30, 34, 36, 37, 38, 40, 43, 44, 46, 48, 51, 54, 55, 56, 58, 61, 63, 64, 66, 70, 71, 73, 74, 78, 79, 80, 82, 85, 86, 88, 90, 92, 94, 97, 100, 102, 103, 106, 108, 109, 112, 113, 115, 118, 120, 121, 123, 129, 133, 135, 141, 144, 150, 158, 159, 160, 163, 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 216, 219, 220, 222, 225, 226, 228, 230, 231, 232, 233, 234, 237, 240, 241, 243, 245, 246, 249, 250, 255, 257, 258, 259, 260, 261, 262, 264, 265, 267, 269, 270, 273, 279, 281, 282}

     

    [1, 10] = P[32], {3, 4, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 37, 38, 40, 43, 44, 46, 49, 51, 52, 54, 58, 61, 63, 64, 65, 67, 68, 70, 73, 74, 78, 79, 81, 82, 85, 86, 88, 91, 94, 96, 97, 100, 103, 104, 106, 108, 109, 112, 113, 115, 117, 119, 121, 126, 131, 132, 136, 138, 144, 147, 148, 153, 156, 160, 161, 168, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 219, 220, 222, 224, 225, 226, 227, 228, 231, 233, 234, 236, 240, 242, 243, 245, 246, 248, 249, 251, 252, 254, 255, 257, 258, 261, 262, 264, 266, 267, 269, 270, 273, 275, 276, 279, 282}

     

    [1, 12] = P[38], {7, 10, 14, 16, 19, 22, 25, 28, 29, 31, 34, 35, 36, 37, 40, 43, 46, 47, 48, 49, 52, 54, 57, 59, 61, 63, 64, 67, 68, 70, 72, 75, 76, 79, 81, 82, 85, 87, 88, 90, 93, 94, 96, 98, 99, 100, 101, 103, 106, 108, 109, 111, 112, 114, 117, 118, 121, 122, 124, 132, 135, 141, 150, 151, 158, 159, 162, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 219, 221, 222, 223, 224, 225, 228, 229, 230, 231, 232, 234, 235, 237, 239, 240, 243, 244, 246, 249, 250, 251, 252, 255, 258, 259, 260, 261, 264, 267, 270, 273}

     

    [1, 14] = P[44], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 49, 51, 52, 54, 57, 58, 61, 62, 64, 65, 69, 71, 72, 73, 76, 78, 80, 81, 84, 85, 88, 90, 93, 94, 95, 100, 102, 103, 106, 109, 111, 112, 113, 115, 117, 120, 121, 124, 127, 132, 133, 138, 141, 145, 150, 153, 159, 162, 165, 168, 171, 173, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 224, 225, 226, 227, 228, 229, 230, 234, 235, 236, 238, 241, 242, 243, 244, 247, 248, 249, 252, 256, 258, 259, 260, 261, 264, 267, 268, 270, 272, 273, 275, 276}

     

    [1, 16] = P[50], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 53, 54, 56, 58, 61, 63, 64, 67, 68, 70, 72, 74, 76, 78, 82, 84, 85, 87, 88, 90, 92, 94, 96, 99, 103, 104, 106, 107, 109, 111, 115, 116, 118, 121, 123, 127, 132, 138, 141, 143, 147, 156, 159, 160, 168, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 225, 226, 227, 228, 231, 232, 233, 235, 238, 240, 242, 243, 244, 246, 247, 249, 250, 252, 253, 255, 256, 258, 259, 260, 261, 264, 267, 270, 272, 273, 275, 276, 281}

     

    [1, 18] = P[56], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 60, 62, 64, 66, 68, 70, 73, 75, 76, 78, 80, 82, 85, 86, 88, 89, 93, 94, 96, 98, 100, 102, 105, 106, 109, 110, 113, 114, 116, 118, 119, 121, 123, 129, 132, 136, 144, 148, 153, 168, 169, 170, 171, 172, 173, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 217, 218, 219, 221, 222, 223, 225, 229, 230, 234, 235, 237, 239, 240, 243, 244, 245, 246, 249, 250, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 263, 264, 266, 267, 269, 270, 273, 276, 279}

     

    [1, 20] = P[62], {3, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 63, 64, 67, 68, 72, 73, 74, 76, 79, 80, 81, 82, 85, 87, 88, 90, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 114, 116, 117, 120, 121, 126, 127, 132, 135, 141, 147, 153, 155, 163, 169, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 228, 229, 232, 234, 235, 237, 238, 240, 243, 244, 246, 248, 249, 253, 254, 255, 258, 261, 262, 264, 267, 268, 270, 273, 274, 275, 276, 279, 282}

     

    [1, 22] = P[68], {12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 73, 74, 75, 76, 78, 79, 82, 83, 84, 85, 88, 90, 91, 93, 94, 96, 98, 100, 103, 104, 109, 111, 112, 114, 115, 117, 119, 121, 124, 129, 132, 136, 138, 141, 142, 150, 153, 156, 159, 160, 168, 169, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 216, 217, 218, 219, 220, 224, 225, 226, 228, 230, 231, 232, 233, 237, 238, 240, 241, 243, 247, 249, 251, 252, 253, 254, 255, 258, 261, 262, 264, 267, 270, 273, 274, 275, 276, 279, 282}

     

    [1, 24] = P[74], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 78, 79, 81, 82, 85, 87, 88, 90, 92, 94, 97, 99, 102, 105, 106, 109, 111, 112, 113, 115, 117, 120, 122, 126, 127, 129, 132, 133, 138, 139, 144, 147, 153, 160, 165, 166, 168, 169, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 225, 227, 228, 229, 230, 231, 232, 233, 234, 237, 239, 240, 244, 245, 246, 247, 249, 251, 252, 253, 255, 258, 261, 262, 264, 267, 270, 273, 275, 276, 277}

     

    [1, 26] = P[80], {3, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 82, 83, 84, 86, 88, 91, 92, 95, 96, 99, 100, 103, 104, 106, 108, 110, 112, 115, 117, 120, 121, 124, 125, 126, 127, 128, 130, 132, 138, 139, 141, 145, 150, 153, 159, 162, 166, 174, 178, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 218, 219, 221, 222, 223, 225, 226, 228, 229, 231, 233, 234, 235, 236, 237, 240, 242, 243, 245, 246, 247, 251, 252, 253, 255, 258, 261, 262, 264, 267, 268, 270, 273, 274, 275, 276, 279, 282}

     

    [1, 28] = P[86], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 90, 91, 92, 94, 97, 98, 101, 102, 104, 106, 109, 111, 112, 115, 116, 119, 120, 123, 124, 129, 132, 134, 136, 141, 147, 153, 160, 162, 173, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 221, 224, 226, 227, 228, 233, 234, 236, 237, 240, 241, 243, 244, 245, 246, 247, 249, 250, 251, 252, 254, 255, 257, 258, 259, 260, 261, 263, 264, 266, 267, 270, 273, 276, 279}

     

    [1, 30] = P[92], {7, 10, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 93, 94, 97, 98, 100, 103, 105, 107, 108, 109, 110, 111, 113, 115, 117, 119, 120, 121, 122, 123, 126, 127, 132, 135, 141, 147, 153, 157, 165, 171, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 225, 226, 228, 229, 231, 234, 235, 236, 237, 240, 241, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 262, 264, 267, 268, 270, 273, 275, 276, 279, 281}

     

    [1, 32] = P[98], {10, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 102, 105, 106, 110, 111, 112, 113, 114, 118, 120, 121, 123, 124, 126, 127, 128, 129, 130, 135, 138, 144, 150, 153, 156, 157, 160, 162, 166, 167, 171, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 214, 215, 216, 217, 219, 221, 222, 223, 225, 227, 228, 229, 232, 233, 234, 235, 237, 238, 240, 243, 244, 245, 246, 247, 249, 251, 252, 253, 255, 258, 261, 262, 264, 267, 270, 273, 275, 276, 281}

     

    [1, 34] = P[104], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 95, 97, 100, 101, 103, 106, 108, 110, 113, 115, 116, 118, 120, 122, 126, 132, 134, 138, 141, 147, 152, 160, 161, 171, 172, 173, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 219, 220, 222, 223, 225, 226, 228, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 248, 249, 251, 252, 254, 255, 257, 258, 260, 261, 264, 267, 270, 273, 276}

     

    [1, 36] = P[110], {10, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 117, 118, 120, 121, 124, 125, 129, 134, 135, 136, 138, 139, 141, 142, 144, 145, 147, 150, 151, 154, 156, 162, 171, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 221, 222, 223, 225, 226, 227, 228, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 264, 267, 270, 273, 275, 276, 279, 281}

     

    [1, 38] = P[116], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 120, 121, 124, 125, 129, 135, 136, 141, 147, 150, 156, 158, 165, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 256, 258, 261, 262, 264, 267, 268, 270, 273, 274, 275, 276, 279, 282}

     

    [1, 40] = P[122], {7, 10, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 124, 126, 129, 135, 136, 141, 147, 153, 156, 159, 160, 163, 166, 168, 170, 171, 172, 173, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 240, 242, 243, 244, 245, 246, 247, 249, 251, 252, 255, 258, 261, 264, 267, 270, 273, 275, 276, 279, 281}

     

    [1, 42] = P[128], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 130, 132, 138, 143, 144, 150, 153, 154, 157, 171, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 256, 258, 261, 262, 264, 267, 270, 272, 273, 276, 278, 279, 281, 282}

     

    [1, 44] = P[134], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 138, 140, 144, 150, 159, 162, 168, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 249, 250, 251, 252, 253, 255, 256, 258, 261, 262, 264, 267, 268, 270, 273, 275, 276, 281}

     

    [1, 46] = P[140], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 150, 159, 162, 168, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 249, 250, 251, 252, 253, 255, 257, 258, 261, 262, 264, 267, 268, 270, 273, 275, 276, 277}

     

    [1, 48] = P[146], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 150, 155, 156, 159, 162, 165, 166, 168, 172, 176, 177, 178, 179, 180, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 229, 231, 233, 234, 235, 237, 238, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 262, 264, 267, 269, 270, 273, 275, 276, 281}

     

    [1, 50] = P[152], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 156, 159, 160, 162, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 231, 232, 233, 234, 235, 237, 238, 240, 241, 243, 244, 245, 246, 248, 251, 252, 254, 255, 257, 258, 260, 261, 263, 264, 267, 270, 273, 276}

     

    [1, 52] = P[158], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 150, 156, 157, 160, 163, 165, 171, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 231, 232, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 264, 267, 270, 273, 275, 276, 279, 281, 282}

     

    [1, 54] = P[164], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 150, 156, 157, 160, 162, 163, 172, 173, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 229, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 250, 251, 252, 254, 255, 258, 261, 264, 267, 270, 273, 275, 276, 279, 281, 282}

     

    [1, 56] = P[170], {7, 10, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 150, 156, 157, 160, 162, 163, 165, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 251, 252, 255, 258, 261, 264, 266, 267, 270, 273, 275, 276, 279, 281}

     

    [1, 58] = P[176], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 150, 156, 157, 160, 162, 163, 165, 171, 174, 175, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 238, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 264, 267, 270, 273, 275, 276, 279, 280, 282}

     

    [1, 60] = P[182], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 150, 156, 157, 160, 162, 163, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 238, 240, 243, 244, 245, 246, 247, 249, 251, 252, 255, 258, 261, 264, 267, 268, 270, 273, 276, 279, 282, 285}

     

    [1, 62] = P[188], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 150, 156, 168, 171, 172, 173, 174, 175, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 228, 229, 231, 233, 234, 235, 236, 237, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 262, 264, 265, 267, 270, 273, 275, 276, 279, 281}

     

    [1, 64] = P[194], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 153, 156, 157, 160, 162, 163, 171, 173, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 225, 226, 228, 229, 231, 233, 234, 235, 237, 240, 242, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 264, 267, 270, 273, 275, 276, 279, 281}

     

    [1, 66] = P[200], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 132, 137, 141, 144, 150, 153, 157, 168, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 250, 251, 252, 253, 255, 258, 261, 262, 264, 267, 270, 273, 275, 276, 277, 279, 282}

     

    [1, 68] = P[206], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 128, 133, 138, 141, 144, 150, 156, 157, 159, 160, 162, 168, 172, 173, 174, 175, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 221, 222, 223, 225, 226, 228, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 262, 264, 267, 268, 270, 273, 275, 276, 279, 282}

     

    [1, 70] = P[212], {7, 10, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 126, 132, 135, 138, 141, 145, 150, 153, 157, 159, 161, 165, 166, 168, 171, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 249, 250, 251, 252, 255, 258, 261, 264, 267, 270, 275, 281}

     

    [1, 72] = P[218], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 112, 114, 118, 119, 121, 122, 124, 126, 132, 133, 138, 141, 144, 150, 159, 166, 169, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 215, 216, 219, 220, 221, 222, 223, 224, 225, 226, 228, 231, 233, 234, 235, 237, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 259, 260, 261, 263, 264, 266, 267, 269, 270, 272, 273, 276, 279}

     

    [1, 74] = P[224], {3, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 101, 103, 105, 107, 109, 113, 114, 116, 117, 121, 122, 124, 126, 129, 135, 141, 143, 147, 152, 153, 160, 165, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 217, 219, 220, 221, 222, 226, 228, 231, 233, 234, 235, 237, 240, 241, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 262, 264, 267, 268, 270, 271, 273, 275, 276, 279, 281, 282}

     

    [1, 76] = P[230], {7, 10, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 92, 93, 95, 97, 100, 102, 103, 105, 107, 109, 111, 116, 117, 120, 121, 123, 125, 127, 131, 135, 141, 143, 144, 148, 153, 156, 157, 163, 168, 169, 171, 172, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 228, 229, 231, 233, 234, 235, 236, 237, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 264, 267, 270, 273, 275, 276, 290}

     

    [1, 78] = P[236], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 88, 89, 91, 93, 95, 97, 100, 103, 104, 107, 108, 110, 113, 114, 116, 118, 120, 122, 126, 128, 134, 135, 139, 141, 147, 150, 153, 156, 159, 162, 165, 167, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 214, 215, 216, 217, 218, 219, 220, 223, 225, 226, 228, 229, 231, 232, 233, 234, 235, 237, 238, 240, 243, 244, 245, 246, 247, 251, 252, 253, 255, 258, 261, 262, 264, 267, 268, 270, 273, 275, 276, 281}

     

    [1, 80] = P[242], {7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 75, 79, 81, 82, 84, 85, 87, 90, 91, 96, 97, 99, 100, 102, 104, 107, 109, 110, 112, 114, 117, 120, 121, 125, 126, 127, 130, 131, 138, 141, 144, 150, 152, 153, 154, 159, 163, 166, 174, 175, 176, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 218, 219, 220, 221, 222, 223, 228, 229, 231, 234, 235, 236, 237, 238, 241, 243, 244, 245, 246, 247, 249, 251, 252, 253, 255, 258, 261, 262, 264, 267, 270, 272, 273, 275, 276, 281}

     

    [1, 82] = P[248], {7, 10, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 62, 63, 65, 67, 70, 71, 73, 76, 77, 79, 81, 83, 85, 88, 90, 92, 93, 96, 97, 99, 102, 103, 105, 107, 108, 109, 110, 112, 113, 117, 118, 121, 122, 126, 127, 132, 133, 136, 138, 144, 147, 150, 156, 158, 162, 168, 171, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 221, 222, 226, 227, 229, 230, 232, 234, 235, 237, 238, 240, 241, 243, 244, 246, 249, 251, 252, 253, 255, 258, 261, 262, 264, 267, 270, 271, 273, 275, 276, 280, 281}

     

    [1, 84] = P[254], {7, 10, 14, 16, 19, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 51, 53, 55, 58, 59, 61, 63, 65, 68, 69, 71, 72, 73, 74, 76, 79, 81, 82, 85, 86, 91, 93, 94, 96, 97, 99, 101, 103, 108, 109, 110, 111, 113, 115, 118, 120, 124, 127, 132, 133, 135, 141, 144, 147, 148, 150, 151, 153, 154, 156, 159, 162, 165, 168, 169, 171, 172, 174, 175, 176, 177, 178, 179, 180, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 219, 220, 221, 222, 223, 224, 226, 228, 230, 231, 232, 234, 235, 239, 240, 242, 246, 247, 249, 250, 252, 255, 258, 261, 264, 267, 270, 273, 275, 276, 279, 281}

     

    [1, 86] = P[260], {10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 52, 53, 55, 58, 60, 63, 64, 67, 68, 70, 71, 74, 75, 77, 79, 80, 81, 82, 85, 87, 89, 93, 94, 96, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 126, 127, 132, 133, 135, 141, 142, 144, 150, 151, 153, 159, 162, 163, 165, 166, 172, 174, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, 228, 229, 231, 232, 234, 235, 236, 239, 240, 241, 243, 246, 247, 248, 249, 251, 253, 254, 255, 258, 261, 263, 264, 267, 270, 272, 273, 275, 276, 281}

     

    [1, 88] = P[266], {12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 36, 37, 38, 40, 43, 46, 47, 49, 52, 53, 55, 57, 59, 61, 63, 65, 67, 68, 71, 72, 74, 76, 79, 80, 82, 84, 87, 88, 91, 93, 94, 96, 100, 102, 103, 104, 108, 109, 111, 113, 117, 119, 121, 123, 127, 128, 135, 141, 145, 147, 151, 152, 153, 157, 161, 162, 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 209, 210, 213, 214, 215, 216, 217, 220, 222, 223, 225, 228, 229, 231, 233, 237, 238, 239, 240, 244, 246, 247, 252, 253, 254, 255, 258, 261, 263, 264, 267, 268, 269, 270, 273, 275, 276, 281}

     

    [1, 90] = P[272], {10, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 35, 39, 40, 41, 43, 46, 49, 50, 51, 52, 54, 55, 58, 59, 60, 62, 65, 66, 68, 71, 73, 76, 77, 79, 80, 84, 85, 87, 90, 91, 94, 97, 99, 100, 101, 103, 106, 109, 110, 111, 112, 113, 114, 115, 117, 120, 121, 123, 129, 130, 132, 138, 144, 147, 148, 150, 153, 155, 162, 163, 168, 171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 214, 216, 217, 219, 220, 222, 223, 224, 225, 228, 229, 230, 231, 232, 233, 234, 235, 237, 239, 240, 243, 244, 246, 247, 250, 251, 252, 254, 259, 261, 263, 264, 267, 268, 269, 270, 273, 276}

     

    [1, 92] = P[278], {4, 7, 10, 12, 14, 15, 16, 19, 21, 22, 25, 28, 29, 31, 34, 36, 37, 39, 41, 43, 46, 47, 49, 51, 55, 56, 58, 59, 60, 64, 65, 67, 69, 71, 73, 74, 79, 81, 82, 83, 85, 87, 89, 91, 94, 96, 97, 100, 101, 104, 105, 107, 111, 114, 115, 116, 118, 120, 122, 124, 126, 130, 135, 138, 141, 144, 154, 157, 159, 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 214, 216, 217, 219, 221, 223, 224, 225, 226, 228, 230, 231, 233, 237, 239, 240, 241, 243, 244, 246, 247, 249, 252, 253, 254, 255, 259, 261, 263, 264, 267, 270, 273, 275, 276, 279, 281, 282}

     

    [1, 94] = P[284], {3, 4, 7, 10, 12, 14, 15, 16, 19, 22, 24, 25, 28, 30, 31, 34, 35, 36, 39, 41, 43, 46, 47, 49, 52, 53, 55, 58, 59, 61, 63, 66, 67, 70, 71, 73, 76, 78, 79, 82, 84, 85, 88, 90, 93, 95, 97, 99, 101, 103, 106, 108, 110, 112, 115, 118, 120, 121, 123, 127, 129, 135, 138, 139, 144, 145, 150, 156, 157, 159, 166, 168, 171, 174, 175, 176, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 213, 214, 216, 217, 219, 220, 222, 223, 225, 226, 227, 228, 229, 231, 232, 234, 235, 237, 238, 239, 240, 241, 242, 243, 246, 247, 251, 252, 254, 255, 257, 258, 260, 261, 264, 267, 269, 270, 273, 274, 275, 279}

     

    [1, 96] = P[290], {7, 10, 12, 13, 16, 17, 20, 21, 23, 25, 27, 29, 31, 32, 35, 37, 39, 43, 44, 46, 48, 49, 52, 53, 55, 58, 60, 61, 64, 65, 66, 67, 69, 70, 73, 75, 77, 80, 81, 84, 85, 88, 89, 91, 94, 96, 98, 101, 102, 104, 106, 109, 111, 112, 114, 116, 118, 121, 124, 126, 127, 129, 133, 135, 141, 142, 144, 150, 156, 161, 163, 166, 168, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 219, 220, 222, 224, 226, 229, 230, 231, 232, 234, 236, 237, 238, 239, 243, 244, 245, 246, 247, 249, 250, 251, 252, 255, 256, 258, 261, 264, 266, 267, 270, 273, 276, 279, 285}

     

    [1, 98] = P[296], {8, 10, 13, 17, 19, 20, 22, 25, 27, 29, 31, 32, 34, 37, 38, 39, 41, 42, 43, 45, 46, 49, 51, 52, 54, 57, 58, 61, 63, 64, 67, 68, 73, 74, 76, 77, 78, 82, 83, 85, 88, 89, 92, 94, 95, 97, 101, 102, 106, 108, 109, 110, 112, 115, 118, 119, 120, 121, 124, 126, 127, 132, 135, 137, 138, 144, 145, 150, 156, 162, 165, 166, 169, 171, 174, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 213, 214, 215, 216, 217, 218, 219, 220, 222, 223, 225, 226, 227, 228, 230, 231, 232, 233, 234, 236, 237, 240, 241, 245, 246, 247, 248, 249, 252, 253, 254, 258, 260, 264, 267, 269, 270, 273, 276, 279}

     

    [1, 100] = P[302], {6, 8, 10, 13, 15, 17, 19, 20, 22, 25, 27, 29, 31, 32, 34, 37, 38, 39, 41, 42, 43, 45, 46, 49, 51, 52, 54, 57, 58, 61, 63, 64, 67, 68, 71, 72, 74, 76, 78, 80, 82, 84, 87, 88, 91, 92, 94, 96, 98, 100, 102, 104, 106, 109, 112, 113, 115, 117, 119, 121, 126, 128, 132, 136, 144, 150, 157, 165, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 219, 220, 222, 225, 226, 227, 228, 229, 230, 231, 233, 234, 235, 237, 239, 241, 243, 244, 246, 248, 252, 253, 254, 258, 259, 260, 264, 265, 267, 268, 270, 273, 276, 278, 279, 282}

     

    numsols = 51

    (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

     

     

    While generating a 3D plot of the solution of an ODE with a parameter, I noticed that better performance could be obtained by calling the plot3d command with a procedure argument, done in a special manner.

    I don't recall this being discussed before, so I'll share it. (It it has been discussed, and this is widely known, then I apologize.)

    I tweaked the initial conditions of the original ODE system, to obtain a non-trivial solution. I don't think that the particular nature of the solution has a bearing on this note.

    restart;

    Digits := 15:

     

     

    The ODE system has two parameters. One, A, will get a fixed value. The

    other, U0, will be used like an independent variable for plotting.

     

     

    eq1:= diff(r[1](t), t, t)+(.3293064114+209.6419478*U0)*(diff(r[1](t), t))
          +569.4324330*r[1](t)-0.3123434112e-2*V(t) = -1.547206836*U0^2*q(t):
    eq2:= 2.03*10^(-8)*(diff(V(t), t))+4.065040650*10^(-11)*V(t)
          +0.3123434112e-2*(diff(r[1](t), t)) = 0:
    eq3 := diff(q(t), t, t)+1047.197552*U0*(q(t)^2-1)*(diff(q(t), t))
           +1.096622713*10^6*U0^2*q(t) = -2822.855019*A*(diff(r[1](t), t, t)):

     

    ics:=r[1](0)=0,D(r[1])(0)=1e-1,V(0)=0,q(0)=0,D(q)(0)=0:

     

    res := dsolve({eq1,eq2,eq3, ics},numeric,output=listprocedure,parameters=[A,U0]):

     

    I will call the procedure returned by dsolve, for evalutions of V(t), as the

    dsolve numeric solution-procedure in the discussion below.

     

    WV := eval(V(t), res):

     

    WV(parameters=[A=1e0]):

     

     

    The goal is to produce a 3D plot of V(t) as a function of t and the parameter U0.

     

     

    tlo,thi := 0.0, 2.0;
    U0lo,U0hi := 1e-3, 2e-1;

    0., 2.0

    0.1e-2, .2

     

    This is the grid size used for plot3d below. It is nothing special.

     

    (m,n) := 51,51;

    51, 51

     

    First, I'll demonstrate that a 3D plot can be produced quickly, by populating a
    Matrix for floating-point evaluations of V(t), depending on t in the first
    Matrix-dimension and on parameter U0 in the second Matrix-dimansion.

     

    The surfdata command is used. This is similar to how plot3d works.

     

    This  computes reasonably quickly.

     

    But generating the numeric values for U0 and t , based on the i,j positions

    in the Matrix, involves the kind of sequence generation formulas that are

    error prone for people.

     

    str := time[real]():
    M:=Matrix(m,n,datatype=float[8]):
    for j from 1 to n do
      u0 := U0lo+(j-1)*(U0hi-U0lo)/(n-1);
      WV(parameters=[U0=u0]);
      for i from 1 to m do
        T := tlo+(i-1)*(thi-tlo)/(m-1);
        try
          M[i,j] := WV(T);
        catch:
          # mostly maxfun complaint for t above some value.
          M[i,j] := Float(undefined);
        end try;
      end do:
    end do:
    plots:-surfdata(M, tlo..thi, U0lo..U0hi,
                    labels=["t","U0","V(t)"]);
    (time[real]()-str)*'seconds';

    1.686*seconds

     

    So let's try it using the plot3d command directly. A 2-parameter procedure
    is constructed, to pass to plot3d. It's not too complicated. This procedure
    will uses one of its numeric arguments to set the ODE's U0 parameter's

    value for the dsolve numeric solution-procedure, and then pass along

    the other numeric argument as a t value.


    It's much slower than the surfdata call above..

     

    VofU0 := proc(T,u0)
           WV(parameters=[U0=u0]);
           WV(T);
         end proc:

    str := time[real]():
    plot3d(VofU0, tlo..thi, U0lo..U0hi,
           grid=[m,n], labels=["t","U0","V(t)"]);
    (time[real]()-str)*'seconds';

    37.502*seconds

     

    One reason why the previous attempt is slow is that the plot3d command

    is changing values for U0 in its outer loop, and changing values of t in its

    inner loop. The consequence is that the value for U0 changes for every

    single evaluation of the plotted procedure. This makes the dsolve numeric

    solution-procedure work harder, by losing/discarding prior numeric
    solution details.

     

    The simple 3D plot below demonstrates that the plot3d command chooses
    x-y pairs by letting its second supplied independent variable be the one
    that changes in its outer loop. Each time the value for y changes the counter

    goes up by one.

     

    glob:=0:
    plot3d(proc(x,y) global glob; glob:=glob+1; end proc,
           0..3, 0..7, grid=[3,3],
           shading=zhue,  labels=["x","y","glob"]);

     

    So now let's try and be clever and call the plot3d command with the two
    independent variables reversed in position (in the call). That will make

    the outer loop change t instead of the ODE parameter U0.

     

    We can use the transform command to swap the two indepenent
    axes in the plot, if we prefer the axes roles switched. Or we could use the
    parametric calling sequence of plot3d for the same effect.

     

    The problem is that this is still much slower!

     

    VofU0rev := proc(u0,T)
           WV(parameters=[U0=u0]);
           WV(T);
         end proc:

    str := time[real]():
    Prev:=plot3d(VofU0rev, U0lo..U0hi, tlo..thi,
                 grid=[n,m], labels=["U0","t","V(t)"]):
    (time[real]()-str)*'seconds';

    plots:-display(
      plottools:-transform((x,y,z)->[y,x,z])(Prev),
      labels=["t","U0","V(t)"],
      orientation=[50,70,0]);

    34.306*seconds

     

    There is something else to adjust, to get the quick timing while using

    the plot3d command here.

     

    It turns out that setting the parameter's numeric value in the
    dsolve numeric solution-procedure causes the loss of previous details
    of the numeric solving, even if the parameter's value is the same.

     

    So calling the dsolve numeric solution-procedure to set the parameter

    value must be avoided, in the case that the new value is the same as

    the old value.

     

    One way to do that is to have the plotted procedure first call the

    dsolve numeric solution-procedure to query the current parameter

    value, so as to not reset the value if it is not changed. Another way

    is to use a local of an appliable module to store the running value

    of the parameter, and check against that. I choose the second way.

     

    And plot3d must still be called with the first independent variable-range

    as denoting the ODE's parameter (instead of the ODE's independent

    variable).

     

    And the resulting plot is fast once more.

     

    VofU0module := module()
           local ModuleApply, paramloc;
           ModuleApply := proc(par,var)
             if not (par::numeric and var::numeric) then
               return 'procname'(args);
             end if;
             if paramloc <> par then
               paramloc := par;
               WV(parameters=[U0=paramloc]);
             end if;
             WV(var);
           end proc:
    end module:

     

    For fun, this time I'll use the parameter calling sequence to flip the

    axes, instead of plots:-transform. That's just because I want t displayed

    on the first axis. But for the performance gain, what matters is that it

    is U0 which gets values from the first axis plotting-range.

     

    str := time[real]():
    plot3d([y,x,VofU0module(x,y)], x=U0lo..U0hi, y=tlo..thi,
           grid=[n,m], labels=["t","U0","V(t)"]);
    (time[real]()-str)*'seconds';

    1.625*seconds

     

    And, naturally, I could also use the parametric form to get a fast plot

    with the axes roles switched.

     

    str := time[real]():
    plot3d([x,y,VofU0module(x,y)], x=U0lo..U0hi, y=tlo..thi,
           grid=[n,m], labels=["U0","t","V(t)"]);
    (time[real]()-str)*'seconds';

    1.533*seconds

     

    Download ode_param_plot.mw

    We have just released updates to Maple and MapleSim, which provide corrections and improvements to product functionality.

    As usual, the Maple update is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2018.2.1 download page, where you can also find more details.

    For MapleSim users, use Help>Check for Updates or visit the MapleSim 2018.2.1 download page.

    Just a simple use of DataFrames.  Looking for a new flashlight, I decided to compile a small selection of flashlights for comparison.
     

    interface(rtablesize = 20)

    Type := `<,>`(LED, LED, LED, Incandescent, Incandescent)``

    BType := `<,>`(AAA, AA, AAA, AA, AAA)

    Make := `<,>`(Maglite, Maglite, Maglite, Maglite, Maglite)

    Batteries := `<,>`(1, 2, 3, 2, 1)

    Lumens := `<,>`(47, 245, 200, 14, 2)

    Model := `<,>`(Solitaire, `Pro+`, XL50, mini, Solitaire)

    Minutes := `<,>`(105, 135, 405, 315, 225)

    Cost := `<,>`(17.49, 41, 46.99, 16.50, 10)

    NULL

    Note:The values for cost used is in Canadian dollars, and the stores for the prices taken were from the following - MEC, Lowes, Canadian Tire and Amazon.ca

    NULL

    NULL

    NULL

    Flashlight := DataFrame(`<|>`(Make, Model, Type, BType, Batteries, Lumens, Minutes, Cost), columns = `<,>`("Make", "Model", "Type", "BType", "Batteries", "Lumens", "Minutes", "Cost"))

    _m652460160

    (1)

    NULL

    numelems(Flashlight)

    40

    (2)

    sort(Flashlight, "Cost")

    _m653259008

    (3)

    sort(Flashlight, "Lumens")

    _m629071232

    (4)

    NULL

    No surprise that the cheapest and lowest light outputs were incandescent flashlights.  The list isn't very large so lets add a few more flashlights to our list

    NULL

    new1 := DataFrame(`<,>`(`<|>`(Thrunite, Ti3, LED, AAA, 1, 130, 30, 26.95), `<|>`(Police*Security, Stealth, LED, AA, 1, 80, 60, 7.99), `<|>`(Police*Security, Shield, LED, AA, 1, 120, 90, 15.99), `<|>`(Fenix, E12, LED, AA, 1, 130, 90, 37), `<|>`(Fenix, E20, LED, AA, 2, 265, 30, 50.75), `<|>`(Fenix, E05, LED, AAA, 1, 85, 45, 31.99), `<|>`(Maglite, mini, LED, AAA, 2, 84, 345, 22)), 'columns' = ["Make", "Model", "Type", "BType", "Batteries", "Lumens", "Minutes", "Cost"], 'rows' = [6, 7, 8, 9, 10, 11, 12])

    _m624778752

    (5)

    F1 := Append(Flashlight, new1)

    _m647087136

    (6)

    sort(F1, "Cost")

    _m627084608

    (7)

    F2 := convert(sort(F1, "Cost", `<`), DataFrame)

    _m650479744

    (8)

    Interesting to note that Police Security generally seems to be the cheapest.

     

     

    sort(F2, "BType")

    _m629097504

    (9)

     

     

    Adding yet more flashlights

     

    new2 := DataFrame(`<,>`(`<|>`(Pelican, 1910*Gen3, LED, AAA, 1, 106, 150, 38), `<|>`(Pelican, 1920*Gen3, LED, AAA, 2, 224, 135, 41)), 'columns' = ["Make", "Model", "Type", "BType", "Batteries", "Lumens", "Minutes", "Cost"], 'rows' = [13, 14])

    _m629911872

    (10)

    F3 := Append(F2, new2)

    _m625417184

    (11)

    sort(F3, "Cost")

    _m641386752

    (12)

    NULL

    Now lets select just the Maglite models

     

    F3[`~`[`=`](F3[() .. (), "Make"], Maglite)]

    _m650462944

    (13)

    ``

    Or select the flashlights that have a burn time longer than 100 minutes

     

    F3[`~`[`>`](F3[() .. (), "Minutes"], 100)]

    _m689998912

    (14)

    NULL


     

    Download flashlight3.mw

    From time to time, people ask me about visualizing knots in Maple. There's no formal "Knot Theory" package in Maple per se, but it is certainly possible to generate many different knots using a couple of simple commands. The following shows various examples of knots visualized using the plots:-tubeplot and algcurves:-plot_knot commands.

    The unknot can be defined by the following parametric equations:

     

    x=sin(t)

    y=cos(t)

    z=0

     

    plots:-tubeplot([cos(t),sin(t),0,t=0..2*Pi],
       radius=0.2, axes=none, color="Blue", orientation=[60,60], scaling=constrained, style=surfacecontour);

     

    plots:-tubeplot([cos(t),sin(t),0,t=0..2*Pi],    radius=0.2,axes=none,color=

     

    The trefoil knot can be defined by the following parametric equations:

     

    x = sin(t) + 2*sin(2*t)

    y = cos(t) + 2*sin(2*t)

    z = sin(3*t)

     

    plots:-tubeplot([sin(t)+2*sin(2*t),cos(t)-2*cos(2*t),-sin(3*t), t= 0..2*Pi],
       radius=0.2, axes=none, color="Green", orientation=[90,0], style=surface);

     

    plots:-tubeplot([sin(t)+2*sin(2*t),cos(t)-2*cos(2*t),-sin(3*t),t= 0..2*Pi],    radius=0.2,axes=none,color=

     

    The figure-eight can be defined by the following parametric equations:


    x = (2 + cos(2*t)) * cos(3*t)

    y = (2 + cos(2*t)) * sin(3*t)

    z = sin(4*t)

     

    plots:-tubeplot([(2+cos(2*t))*cos(3*t),(2+cos(2*t))*sin(3*t),sin(4*t),t=0..2*Pi],
       numpoints=100, radius=0.1, axes=none, color="Red", orientation=[75,30,0], style=surface);

     

    plots:-tubeplot([(2+cos(2*t))*cos(3*t),(2+cos(2*t))*sin(3*t),sin(4*t),t=0..2*Pi],    numpoints=100,radius=0.1,axes=none,color=

     

    The Lissajous knot can be defined by the following parametric equations:

     

    x = cos(t*n[x]+phi[x])

    y = cos(t*n[y]+phi[y])

    z = cos(t n[z] + phi[z])

    Where n[x], n[y], and n[z] are integers and the phase shifts phi[x], phi[y], and phi[z] are any real numbers.
    The 8 21 knot ( n[x] = 3, n[y] = 4, and n[z] = 7) appears as follows:
     

    plots:-tubeplot([cos(3*t+Pi/2),cos(4*t+Pi/2),cos(7*t),t=0..2*Pi],
       radius=0.05, axes=none, color="Brown", orientation=[90,0,0], style=surface);

     

    plots:-tubeplot([cos(3*t+Pi/2),cos(4*t+Pi/2),cos(7*t),t=0..2*Pi],    radius=0.05,axes=none,color=

     

    A star knot can be defined by using the following polynomial:
     

    f = -x^5+y^2

     

    f := -x^5+y^2
    algcurves:-plot_knot(f,x,y,epsilon=0.7,
       radius=0.25, tubepoints=10, axes=none, color="Orange", orientation=[60,0], style=surfacecontour);

     

     

    By switching x and y, different visualizations can be generated:

     

    g=(y^3-x^7)*(y^2-x^5)+y^3

     

    g:=(y^3-x^7)*(y^2-x^5)+y^3;
    plots:-display(<
    algcurves:-plot_knot(g,y,x, epsilon=0.8, radius=0.1, axes=none, color="CornflowerBlue", orientation=[75,30,0])|
    algcurves:-plot_knot(g,x,y, epsilon=0.8, radius=0.1, axes=none, color="OrangeRed", orientation=[75,0,0])>);

     

     

    f = (y^3-x^7)*(y^2-x^5)

     

    f:=(y^3-x^7)*(y^2-x^5);
    algcurves:-plot_knot(f,x,y,
      epsilon=0.8, radius=0.1, axes=none, orientation=[35,0,0]);

     

     

    h=(y^3-x^7)*(y^3-x^7+100*x^13)*(y^3-x^7-100*x^13)

     

    h:=(y^3-x^7)*(y^3-x^7+100*x^13)*(y^3-x^7-100*x^13);

    algcurves:-plot_knot(h,x,y,
       epsilon=0.8, numpoints=400, radius=0.03, axes=none, color=["Blue","Red","Green"], orientation=[60,0,0]);

     

    Please feel free to add more of your favourite knot visualizations in the comments below!

    You can interact with the examples or download a copy of these examples from the MapleCloud here: https://maple.cloud/app/5654426890010624/Examples+of+Knots

    In this post an interesting geometric problem is solved: for an arbitrary convex polygon, find a straight line that divides both the area and the perimeter in half. The following results on this problem are well known:
    1. For any convex polygon there is such a straight line.
    2. For any convex polygon into which a circle can be inscribed, in particular for any triangle, the desired line must pass through the center of the inscribed circle.
    3. For a triangle, the number of solutions can be 1, 2, or 3.
    4. If the polygon has symmetry with respect to a point, then any straight line passing through this point is a solution.

    The procedure called  InHalf  (the code below) symbolically solves this problem. The formal parameter of the procedure is the list of coordinates of the vertices of a convex polygon (vertices must be passed opposite or clockwise). The procedure returns all solutions in the form of a list of pairs of points, lying on the perimeter of the polygon, that are the ends of segments that implement the desired dividing.