Carl Love

Carl Love

28050 Reputation

25 Badges

12 years, 336 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Kitonum See the Wikipedia article that I referenced above. The step length AD must be a multiple of primorial(n) where n is the progression length. Primorial(n) is the product of all primes less than or equal to n.

Primorial(7) = 210.

If AD were equal to 2, then every 3rd term would be divisible by 3, every 5th term divisible by 5, and every 7th term divisible by 7. So there could not be a sequence of primes of length 7.

@Kitonum See the Wikipedia article that I referenced above. The step length AD must be a multiple of primorial(n) where n is the progression length. Primorial(n) is the product of all primes less than or equal to n.

Primorial(7) = 210.

If AD were equal to 2, then every 3rd term would be divisible by 3, every 5th term divisible by 5, and every 7th term divisible by 7. So there could not be a sequence of primes of length 7.

Sorry, I had a typo which I've now corrected. I forgot to include the index variable before the range.

Sorry, I had a typo which I've now corrected. I forgot to include the index variable before the range.

@awass I would read the page ?use carefully before making a habit of using use. But I see no problem with using it at the top level the way you have above if you understand its severe limitation (of being resolved during automatic simplification). The limitation makes it very difficult to use inside a procedure.

Certainly assuming cannot be used in this situation. The two-argument form of eval is usually preferable to subs. For example,

eval('plot'(x^d, x= 0.1..a), [d=3, a=5]);

produces the plot directly, whereas

subs([d=3, a=5], 'plot'(x^d, x= 0.1..a));

does not.

@awass I would read the page ?use carefully before making a habit of using use. But I see no problem with using it at the top level the way you have above if you understand its severe limitation (of being resolved during automatic simplification). The limitation makes it very difficult to use inside a procedure.

Certainly assuming cannot be used in this situation. The two-argument form of eval is usually preferable to subs. For example,

eval('plot'(x^d, x= 0.1..a), [d=3, a=5]);

produces the plot directly, whereas

subs([d=3, a=5], 'plot'(x^d, x= 0.1..a));

does not.

@awass For documentation of backquote `` notation see ?name and ?emptysymbol . For documentation of its use with operators, see ?use and ?overload .

The issue of efficiency is not so simple. In the add / `+` case, if the sequence of summands is already created, then `+` is at least 2-3 times faster than add. If the sequence of summands has not been created, but it can be created with $, then using `+` and $ is likely faster than add.

In the mul / `*` case, it is more complicated. If the multiplication is purely symbolic, then the situation is pretty much the same as with add / `+`. If there is actual numeric multiplication happening (it doesn't matter whether it's exact, float, or hardware float), then mul is slightly faster than `*` regardless of whether the sequence of factors is or isn't already created.

 

@awass For documentation of backquote `` notation see ?name and ?emptysymbol . For documentation of its use with operators, see ?use and ?overload .

The issue of efficiency is not so simple. In the add / `+` case, if the sequence of summands is already created, then `+` is at least 2-3 times faster than add. If the sequence of summands has not been created, but it can be created with $, then using `+` and $ is likely faster than add.

In the mul / `*` case, it is more complicated. If the multiplication is purely symbolic, then the situation is pretty much the same as with add / `+`. If there is actual numeric multiplication happening (it doesn't matter whether it's exact, float, or hardware float), then mul is slightly faster than `*` regardless of whether the sequence of factors is or isn't already created.

 

@ThU Try this. Note that I do not load Vector:-Calculus for this because I don't want to see vectors in e[x], e[y], e[z] notation.

restart:
MyTangentLine:= (V, Pt::(name=algebraic))->
    ``(eval(V,Pt)) + op(1,Pt)*``(eval(VectorCalculus:-TangentVector(V),Pt))
:
MyTangentLine( < sin(t)-t*cos(t),cos(t)+t*sin(t),t^2 >, t= Pi/2 );

@ThU Try this. Note that I do not load Vector:-Calculus for this because I don't want to see vectors in e[x], e[y], e[z] notation.

restart:
MyTangentLine:= (V, Pt::(name=algebraic))->
    ``(eval(V,Pt)) + op(1,Pt)*``(eval(VectorCalculus:-TangentVector(V),Pt))
:
MyTangentLine( < sin(t)-t*cos(t),cos(t)+t*sin(t),t^2 >, t= Pi/2 );

@Markiyan Hirnyk Most good art is created for art's sake.

@Markiyan Hirnyk Most good art is created for art's sake.

To prevent cut-and-pasted sections of code and Maple 2D output from looking weird, select "Preformatted" from the pull-down list in MaplePrimes while your cursor is at the place where you want to paste.

@Alex Joannou Yes, it should work with any structure, even those as yet undefined.

@Alex Joannou Yes, it should work with any structure, even those as yet undefined.

First 613 614 615 616 617 618 619 Last Page 615 of 709