David Sycamore

35 Reputation

0 Badges

1 years, 16 days

MaplePrimes Activity


These are replies submitted by David Sycamore

@vv Would it be possible to modify the previous code so as to output odd squarefree composite numbers having at least 3 prime divisors and the property that the only prime divisors p such that p-1|n-1 are the smallest and the greatest prime factors of n? 

The (provisional) data I have so far is: 231,1045, 1653, 4371, 4641, 5365, 6545, 8029, 9361, 10011, 10857

Best Regards

David Sycamore.

 

 

@Carl Love 

Regarding your comment about the squarefree function not being a check for squarefree but for returning the squarefree factorisation, I find this not to be quite the case.

Using with(NumberTheory) I find that IsSquareFree(n) returns the correct answer. Perhaps the capitalisation calls a different version?

Any comment?

@Carl Love Thanks,

By the way I found a way to compute all conforming terms up to an arbitrary N, just put your proc into a do loop; easier than I expected. 

@Carl Love 

I had not seen the (Kitonem)  comment about "squarefreee" before I replied to you last. Should something be changed ?

 

@Kitonum 

Thanks for your reply, which works for individual n as your example shows. How does the check for "squarefree" work? I thought there was a routine called "Squarefree" which could be called to do this but I dont see it in either reply. I woud like to adapt the code to compute all n<= any chosed N which have the property; is that possible?

Regards

David Sycamore.

@Carl Love 

Thanks Carl, 

It works fine for any selected individual number n. Could you suggest how I could adapt it so as to compute for some upper limit N, all n <= N which have this property?
Best regards

David.

@Kitonum 

Thank you very much, it works very nicely. I wonder if there is a modification you could suggest which would display the output in the form n, a(n) ? (so I can the correspondence see without counting every time)

Ceers

David.

@Carl Love 

Hi Carl,

Thank you.

To answer your question:

a(1)=1.

a(1)+1=2, a prime, so a(2)=a(1)+1=2

a(2)+1=3, a prime, so a(3)=a(2)+1=3

a(3)+1=4, composite and a(3) is odd so a(4)=a(3)+3=6

a(4)+1 =7, prime, so a(5)=a(4)+1=7.

a(6)=10

a(7)=11

a(8)=14, etc

Do you see what I’m trying to do?

Maybe my original explanation was not clear, hope this is better

David.

@David Sycamore 

Hello again. I ran into a problem with p=397 because the code runs out to N without finding a value for k,  and increasing N leads to a seemingly endless run. According to my calculation this prime should have a k value, and it should be a number == 0 mod 6. So I was wondering if the code could be adapted to restrict k >0 to values == 0 mod 6? This should mean faster computation, and if my hunch is right, produce a result. Would you mind to suggest something?

Thanks

David. 

@Kitonum 

Magic! 

Kitonum,

Thank you so much, you made my day. I need to learn how a proc works. Your code is a good starting point :-)

David. 

@Kitonum 

Thank you! I was glad to see k values for  79 and 167, as suspected. 

Can you please tell me where to enter the chosen prime into the code? I tried replacing p with 59 in the process, but this gave an error (invalid procedure parameters). Clearly I am doing something wrong.

Thanks

David.

@Carl Love 

Have now run full code in 1D and also run truncated code so as to get data only. Latter shows PP(p) not strictly increasing.  Able now to construct second sequence I mentioned to you.

Agree your latest derivation of asymptotic value though since it’s so close to original Li(p)^2/2*p (as p->00), might as well use latter (seemed to fit well in the plot). 

Will enter sequence in oeis when space available and let you know.

Might take a while...

 

David.

@Carl Love 

Hi Carl, thanks for that.

Sadly I have had no education in coding in any language so I struggle with it, trying to learn as I go along. Despite this I have had some minor successes. However, for me your code is a highly sophisticated piece of work, employing devices and structures which I have not seen before. I asked Mapleprimes for help with this because i could not do it myself and wanted to see what a proper solution would look like. What I hoped for was a code to calculate the data and so was surprised to see that your work went much further than that; the data,the plot plus your intuitions; all good stuff. I  have already tried to separate the data calculation from the plot, and will keep trying. What seems trivial for you is not so for me. If you know of a good book on Maple please let me know. I am very eager to learn this.

Cheers

David.

@Carl Love 

Hi, Thanks for your posts. No good today, travel again, just time for a few remarks:

Li function indeed better behaved than pi; continuous and différentiable, just that singularity to deal with. Have seen two versions, with different lower limits of integral; one with 0 the other with 2. Don’t suppose it makes much difference as

x—>00 but as matter of interest which are you using?

Despite the change from p/2 to 2*p I got correct data; strange. 

Might be better for oeis if code for data can be decoupled from code for plot. Latter could then be a link (they have a separate section for links in any submission). 

Thought: Consider triple (a,b,c) where a,b,c are all primes <prime p and such that a*b*c==1mod p. Presumably your code could be adapted to find such triples for arbitrary p, just as it did for the pairs (a,b) ? 

eg: 2*3*5==1mod 29.

This might lead to an asymptotic formula, residues etc, similar to the case for prime pairs. Likewise, generalisation to r-tupples: 

(a,b,c,d.....r) might be worth looking at. Does this sound interesting?

Dashing now catch up later

Cheers

David. 

 

@Carl Love 

Thanks, I got your code to run but no plot yet. What I have is a long list of Matrix output in the form [p, PP], from p=2 up to p=67523. There is an error message saying “unexpected options: [n=2.*Matrix*( then the data.

There were a couple of things in the code: first in Asy the denominator was 2/p so I changed it to 2*p in line with your earlier remarks. Then at the end of the CountPairs proc there was an isolated n after od; which I did not touch; does it mean something?

I did not yet try your last suggestion for extracting the data directly, is there a special place in the code where I should enter CountPairs(nextprime(10000))?

I need the raw data so as to enter it in oeis, which does not accept a sequence without data. I will of course attribute the code, and no doubt somebody else will add another code to verify the data (probably Pari). The plot could come in a separate link, once I have it, and that will be attributed as well.

You have been so helpful, and spot on  with your intuition; very much appreciated. 

 

Cheers

David.

1 2 3 Page 1 of 3