Carl Love

Carl Love

28150 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@ajfriedlan Issue the command currentdir(); before both the save and read commands. Do the two currentdirs return the same string? If not, that's your problem. Use currentdir("some path name") to set the current directory to the same value in each worksheet.

@tomleslie I'm not sure---and I wouldn't mind being proven wrong---but I don't think that that'll work with a Matrix of highly symbolic entries such as described by the OP.

@ajfriedlan Sorry, I missed a comma in my command. It should be

save M, "MyData.map";

@David Sycamore I need you to clarify the rule "a(n+1) = index of the last term k = a(n)". In particular, what is meant by index and what is meant by last? I can think of two conflicting definitions for each:

Index: For the term a(n), is n the index? Or is n+1 the index because the term appears in the (n+1)th ordinal position?

Last: In the sequence 1, 2, 3, is 1 or 3 the last term?

@Kitonum I hope that you don't need me to tell you that that's extremely inefficient; for example, it takes over 500 times as long as mine to compute the first 2^13 terms.

@mtango345 For the example in your Reply immediately above, r:= <cos(2*t), sin(2*t), 4*t>, it is trivial to get a closed-form expression for the arclength over any interval 0 <= tau <= t, as you have done: s = 2*sqrt(5)*t. And then it's trivial to find the inverse function of that: t = s/2/sqrt(5). If you try to do that with your original function r:= <cos(2*t), sin(3*t), 4*t>, you'll find that the arclength integral is quite complicated, and finding its symbolic inverse is impossible. Hence, numerical methods are used in the Answers by Kitonum and VV.

Do you intend there to be any relationship between any of the  variables u[], u[1], u[2], u[1,1], u[1,2], u[2,2]? If they are all intended to be independent of each other, that is fine. But u[] seems to be a strange name for a variable.

@zhuxian "1D" is an abbreviation of "one-dimensional" which is another name for "plaintext" or ASCII or character style Maple Input.

@TeyhaNeedHelp So, if you look closely at the equations in the paper, is it true that the boundary condition is f ' '(6) = 0, as I guessed? Surely f ' '(0) = 0 is incorrect; that's obvious from the plot.

@zakaria You're welcome. I'm sorry that I cannot investigate your Question further because I don't have MapleSim. I hope that someone else will get to it. You will greatly improve your chances of getting an Answer if you upload all relevant files, not just pictures (screenshots).

@David Sycamore I'm not sure exactly what you're saying/asking about twin primes, but hopefully this Reply will clear up some issues for you anyway.

Let's apply the Proposition with which I started this Answer to finite arithmetic progressions (APs)[*1]: Any AP-3 (p, p+2, p+4) necessarily contains a multiple of 3 (which may be 3 itself), regardless of whether p is prime. So 3, 5, 7 is the only possible AP-3 of twin primes. Thus, if the even number e for the example is 2, then P must start 3, 5, .... Likewise, any AP-3 (p, p+4, p+8) also necessarily contains a multiple of 3, so 3, 7, 11 is the only possible AP-3 of cousin primes; and so if e=4, then P must start 3, 7, .... But if e is a multiple of 6, the situation is different: (p, p+6, p+12) definitely does NOT contain a multiple of 3 for p prime, p > 3. This allows the possibility of examples starting 5, 11, ...; 7, 13, ...; 5, 17, ...; etc., and indeed my program in the Reply immediately above has generated examples for these.

The significance of 6 is that it's the primorial[*2] of 3, sometimes denoted 3#. Proposition 2: If an AP-n (q + k*e $ k= 0..n-1), q > n, contains only primes, then necessarily e is a multiple of n#.

[*1] Definition: A finite arithmetic progression (AP) is a finite sequence of n terms x, x+d, x+2*d, ..., x + (n-1)*d. In Maple syntax that's (x + k*d $ k= 0..n-1). An AP of n terms is sometimes called an AP-n. While in general d <= 0 is allowed, there's no point in considering this case for the study of prime numbers. So, I'll specify that d > 0, and so all APs are strictly increasing sequences. If every term of an AP-n is prime, it's sometimes called a PAP-n.

[*2] Definition: For x > 0, we define the primorial of x as the product of all primes less than or equal to x. It is sometimes denoted x#; however, this is not Maple syntax.

I gave this Question a Vote Up yesterday, as can be seen in its header. So why is the OP's reputation still 0?

@David Sycamore N is declared in the first line of doWork (its proc(...) line) as its second parameter. Hence, the subsequent call doWork(j, Neven) makes N equal to Neven.

@David Sycamore Here is a procedure to construct examples of the phenomenon being discussed. It works for any even number as the initial spacing, so not necessarily twin primes.

restart
:
(*>>>-------------------------------------------------------------------------------------
| Given primes p1 and p2 such that p2 > p1 and p2+(p2-p1) is also prime, this procedure  |
| attempts to return a set P of primes containing p1 and p2 such that there exists a     |
| *unique* e > 0 such that P +~ e is entirely prime. If successful, then necessarily     |
| e = p2-p1 and |P| = p2. If not, and execution is halted, then the global MAXP is the   |
| largest prime that was examined for possible inclusion in P.                           |
-------------------------------------------------------------------------------------<<<*)
FindFiniteExample:= proc(
   p1::prime, 
   p2::And(prime, satisfies(p-> p > p1 and isprime(2*p-p1)))
)
option `Author: Carl Love <carl.j.love@gmail.com> 3-Oct-2019`;
global MAXP:= p1;
local 
   e:= p2-p1, r2:= p1 mod p2, R2:= MutableSet(r2),
   p:= p1, P:= MutableSet(p1)
;
   while numelems(P) < p2 do
      p:= nextprime(p);
      if isprime(p+e) then
         r2:= p mod p2;
         if not r2 in R2 then MutableSet:-insert~([R2,P],[r2,p]) fi
      fi;
      :-MAXP:= p
   od;
   convert(P, set)
end proc
:
#Usage:
FindFiniteExample(3,5);
                       {3, 5, 11, 17, 29}
FindFiniteExample(3,7);
                   {3, 7, 13, 19, 37, 43, 67}
FindFiniteExample(5,11);
          {5, 11, 13, 17, 23, 31, 37, 41, 47, 73, 131}
FindFiniteExample(3,11);
        {3, 11, 23, 29, 53, 59, 71, 101, 131, 149, 173}
FindFiniteExample(3,17);
{3, 17, 23, 29, 47, 53, 59, 83, 89, 113, 137, 167, 179, 197, 449, 
  509, 617}
FindFiniteExample(5,17);
{5, 17, 19, 29, 31, 41, 47, 59, 61, 67, 71, 89, 137, 151, 179, 
  181, 227}
FindFiniteExample(7,13);
     {7, 13, 17, 23, 31, 37, 41, 47, 53, 61, 97, 103, 107}
FindFiniteExample(11,17);
{11, 17, 23, 31, 37, 41, 47, 53, 61, 67, 73, 83, 97, 103, 157, 
  263, 383}

So, it seems that examples are easy to find.

Edit: The code above has been simplified, although the original code was also correct. The output of the examples shown will in some cases be different.

@David Sycamore You asked about the notation P +~ e. This adds e to each element of P. Likewise both P mods~ p and irem~(P, p) compute the remainders mod p of all elements of P. See help page ?elementwise 

First 252 253 254 255 256 257 258 Last Page 254 of 711