Carl Love

Carl Love

16317 Reputation

23 Badges

7 years, 133 days
Mt Laurel, New Jersey, United States
My name was formerly Carl Devore. I was in the PhD math program at University of Delaware until 2005. I was very active in the Maple community at that time.

MaplePrimes Activity

These are replies submitted by Carl Love

@Kitonum A variation of that that works in 1D input is

'`>=`'(a, b) 

(That's single forward quotes (aka unevaluation quotes) on the outside and single backward quotes (aka name quotes) on the inside.) The prettyprinted output is in the standard infix form, without any quotes.

@Fzen If it's only the output form that matters to you, rather than changing a default, then you can use inert operators in prefix functional form. For example, the input

`%>`(a, b)

produces the output

a > b

and likewise for `%>=`.

Inert expressions can be converted to active form with the command value


@RLessard You wrote:

  • The trick is to eliminate the term (2*i + 2*k)!  keeping only (2*i)!

Yes, that's exactly right. Once the factorial is thus reduced, each individual power series of the decomposition is immediately recognized as a variation of cos(x), and the more-complicated hypergeom representation is avoided.

@litun You wrote:

  • As I know list is used for discrete parameters (natural numbers) and function for continuous parameters (real numbers).

That's not true. And not only is it not true, but in a Maple construction such as F[1,2](3.4), the [1,2] is not even a list; it's an index. A function's arguments (arguments is a better term than parameters in this context) can be placed in the index or in the main parentheses, but the reasons for choosing to put them in the index are mostly stylistic and have nothing to do with whether they are discrete or continuous. Index arguments are more difficult to program, and I recommend that you avoid them for now.

VV's Answer uses Maple 2019 syntax. 

@David Sycamore A symbol that looks similar to a stylized Greek phi is indeed a standard symbol for the empty set. Given that, {phi} represents the set that contains the empty set as its sole element, which is not the same thing as the empty set itself. If you're restricted to ASCII (plaintext) input, you can use { } unambiguously for the empty set, and this can also be used as Maple Input.

@Kitonum By {phi}, he means the empty set (although this notation is inaccurate).

@Stretto You wrote:

  • No where on that page do they talk about using a database for pi(x).

Here is the relevant passage about the database for pi(x):

  • Andrey V. Kulsha has a file of the successive rounded values of 1.5*(π(x)-li(x)) for the 100,000,000 multiples of 109 less than 1017.... In 2014, Andrew Carr and I converted these to actually differences (rather than successive differences) so we can find π(x) for multiples of 109 with a single file read and a quick calculation of li(x). For other values we use the nearest multiple of 109 and sieve the region between to find π(x).

@Stretto You said, "Maple gives no indication how it is computing pi(x)." You can read the code via


You can see that it's quite simplistic compared to VV's.

@vv Good work on that procedure, and vote up.

Its time can be improved significantly with some remember tables and replacing some calls to ithprime with equivalent calls to nextprime.

Lpi := module()  # Lehmer pi
      phi := proc(x, a)
      option remember;
          if a <= 1 then iquo(x + 1, 2)
          else thisproc(x, a-1) - thisproc(iquo(x, ithprime(a)), a-1)
      end proc,

      ModuleApply:= proc(x)
      option remember;
      local a,b,c,s,w,i,j,L, xx:= trunc(x), p_i, p_j;
          if xx < M then return NumberTheory:-pi(x) fi;
          a := thisproc(iroot(xx, 4));;
          b := thisproc(isqrt(xx));
          c := thisproc(iroot(xx, 3));
          s := phi(xx,a) + (b+a-2) * (b-a+1) / 2;
          p_i:= ithprime(a+1)-1;
          for i from a+1 to b do
              w := iquo(xx , (p_i:= nextprime(p_i)));
              L := thisproc(isqrt(w));
              s-= thisproc(w);
              if i <= c then
                  p_j:= p_i - 1;
                  for j from i to L do
                      s-= thisproc(iquo(w , (p_j:= nextprime(p_j))))
                          - j + 1
      end proc
end module:

memory used=3.40GiB, alloc change=80.00MiB, cpu time=29.58s, real time=26.99s, gc time=6.81s


By putting it in a module, as I have above, it will "learn" from each usage, making subsequent usages faster.

What do you mean by "I would like to plot the plane formed by the solutions"? The solution is a single point.

@mathkid99 It looks like you had specified elementwise multiplication rather than the usual matrix multiplication. Using the usual input syntax (rather than the more-elaborate form that's shown in your transcript), the elementwise multiplication of matrices and is A *~ B, and the usual matrix multiplication is A . B (spaces optional in both cases). Of course, each of these operations has its own size-matching requirements for the operands.

@kelvin goh It should be g, not g(x). It should be undefined, not undefine.

Even by imposing various severe conditions on the parameters (such as k_1= 0, k_2= 0), I can't get any solution where z <> 0 or w <> 0.

@Carl Love Here's the same thing done in code that should work in Maple 2015:


Veq:= 3/2-9/2*exp(-2*x)-9/2*exp(-x)+1/2*int(exp(-y)*Z(x-y), y= 0..ln(2));

3/2-(9/2)*exp(-2*x)-(9/2)*exp(-x)+(1/2)*(int(exp(-y)*Z(x-y), y = 0 .. ln(2)))

eps:= 1e-4:
S[0]:= 3/2: S[-1]:= 0:

for n while evalf(Int(abs@(S[n-1]-S[n-2]), 1.5..3.5)) >= eps do
    S[n]:= unapply(eval(Veq, Z= S[n-1]), x)



plot(S[n-1], 1.5..3.5);




1 2 3 4 5 6 7 Last Page 1 of 488