Carl Love

Carl Love

28110 Reputation

25 Badges

13 years, 121 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

Are the equations in the Word file in proper Maple syntax, with asterisks used for multiplication and "less than or equal" represented as "<="?

I think that it is legitimate. Advanpix is using hardware quadruple precision (128-bit hardware floats). Maple doesn't have that. The quad precision is being compared against Maple's software floats with Digits set to 34.

@brian bovril Okay, here it is with the requested modification. Every time that it gets to a new longest sequence, it prints it and continues searching for the main sequence.

Note that for AD=210, n=11, the only possibilities are sequences starting with 11.

I did find the smallest example of AD = primorial(11), n=11, with the above code in under an hour. I think they were 7-digit  numbers.

IsPrime:= proc(n) option cache; isprime(n) end proc:

APSearch:= proc(AD::posint, n::posint)
     local SP:= 1, longest:= 0, j, k, S;
     do
          SP:= nextprime(SP);
          S:= SP + k*AD $ k = 1..n-1;
          if andmap(IsPrime, [S]) then
               return [SP, S]
          else
               for j from longest to n-1 do
                    if andmap(IsPrime, [S[1..j]]) then
                         longest:= j+1;
                         print([SP,S[1..j]])
                    else
                         break
                    end if
               end do
          end if           
     end do
end proc:   

APSearch(210,11);
                              [2]
                           [13, 223]
                         [13, 223, 433]
                      [13, 223, 433, 643]
                    [13, 223, 433, 643, 853]
                 [13, 223, 433, 643, 853, 1063]
              [47, 257, 467, 677, 887, 1097, 1307]
          [199, 409, 619, 829, 1039, 1249, 1459, 1669]
       [199, 409, 619, 829, 1039, 1249, 1459, 1669, 1879]
    [199, 409, 619, 829, 1039, 1249, 1459, 1669, 1879, 2089]
Warning,  computation interrupted


 

@brian bovril Okay, here it is with the requested modification. Every time that it gets to a new longest sequence, it prints it and continues searching for the main sequence.

Note that for AD=210, n=11, the only possibilities are sequences starting with 11.

I did find the smallest example of AD = primorial(11), n=11, with the above code in under an hour. I think they were 7-digit  numbers.

IsPrime:= proc(n) option cache; isprime(n) end proc:

APSearch:= proc(AD::posint, n::posint)
     local SP:= 1, longest:= 0, j, k, S;
     do
          SP:= nextprime(SP);
          S:= SP + k*AD $ k = 1..n-1;
          if andmap(IsPrime, [S]) then
               return [SP, S]
          else
               for j from longest to n-1 do
                    if andmap(IsPrime, [S[1..j]]) then
                         longest:= j+1;
                         print([SP,S[1..j]])
                    else
                         break
                    end if
               end do
          end if           
     end do
end proc:   

APSearch(210,11);
                              [2]
                           [13, 223]
                         [13, 223, 433]
                      [13, 223, 433, 643]
                    [13, 223, 433, 643, 853]
                 [13, 223, 433, 643, 853, 1063]
              [47, 257, 467, 677, 887, 1097, 1307]
          [199, 409, 619, 829, 1039, 1249, 1459, 1669]
       [199, 409, 619, 829, 1039, 1249, 1459, 1669, 1879]
    [199, 409, 619, 829, 1039, 1249, 1459, 1669, 1879, 2089]
Warning,  computation interrupted


 

alias(x= RootOf(_Z^3+_Z+1)):
Normal(1/x^2) mod 7;

alias(x= RootOf(_Z^3+_Z+1)):
Normal(1/x^2) mod 7;

Good point. But your `and` is superfluous and potentially dangerous (if you were dealing with <> inequalities it would evaluate). All the conditions in the expression sequence passed to solve (and most other commands) are assumed to be in conjunction.

Good point. But your `and` is superfluous and potentially dangerous (if you were dealing with <> inequalities it would evaluate). All the conditions in the expression sequence passed to solve (and most other commands) are assumed to be in conjunction.

@sunit If you can rearrange it to a first-order system, then you should do so. It looks straightforward to me also.

I was hoping that Preben would see this here. Give it a few days.

That's a really nice use of ``.

Maple gets the antiderivative to this almost instantly. So why does the definite integral take several seconds, even if I specify method= ftoc?

That's a really nice use of ``.

Maple gets the antiderivative to this almost instantly. So why does the definite integral take several seconds, even if I specify method= ftoc?

@sunit Even if I replace your a0 and d by 0, I still get an error "Unable to convert to a first-order system". I don't know why. Hopefully someone else will take a look at it. I think that Preben Alsholm could solve it. After that problem is solved, I think that the conditions with a0 and d can be easily handled with piecewise.

I think that you need one more initial condition. You don't have any for a[2].

You'll need to give an explicit example of an expression that gives the error.

@sunit I editted it for you.

@Art Kalb Ah, I think that I understand your problem: I think that you have the mistaken impression that the behaviour of f(g(x)) can be controlled by a procedure named `f/g` for arbitrary f and g. The reality is that that mechanism only works for a few select system routines f, for example, evalf, print, type, value, diff.

First 602 603 604 605 606 607 608 Last Page 604 of 710