New sequence : parallel "prime"

Math help on Congruences, Modulo, Fermat's Theorem, Fermat's Last Theorem (FLT), Euler's Theorem, Euler Totient Function, Divisors, Multiples, Prime Numbers, Prime Number Theorem, Distribution of Prime Numbers, Dzeta Function, Riemann Hypothesis, Algebraic Number Theory, Analytic Number Theory on My Math Forum.
Math problems in Number Theory

Re: New sequence : parallel "prime"

Postby CRGreathouse » Sat Feb 06, 2010 9:16 pm

momo wrote:You have to read the last posts.
The algorithm was yet sent.


Sorry, I must have missed it in the flurry of posts.

momo wrote:I'm sorry I did a miscalculation.
I have to review the algorithm but it is not wrong in theory.
I"m tired now.
I go to sleep.
Tomorrow I will correct it.
You can correct it if you undesrstood the principle.


I do not understand the principle, but I'll look over the algorithm when you correct it (tomorrow or whenever is convenient).
User avatar
CRGreathouse
Joker
Joker
 
Posts: 5300
Joined: Sat Nov 25, 2006 9:52 am
Location: UTC -5

Re: New sequence : parallel "prime"

Postby CRGreathouse » Sun Feb 07, 2010 1:38 am

billymac, I don't entirely understand your program (at least not well enough to speed it up), but here's my version of your code:
Code: Select all
parallelPrime2(lim=25)={
   my(syze=100000,arr,a=1,lim2=997,minn,v=[1]);
   arr=List(vector(syze, i, i));

   for(ctr=1,lim,
      ptr=a;
      move=2;

      forprime(move=2,lim2,
         ptr += move;      \\eg 1+2, then 1+3, then 1+5,1+7,1+11,...
         if(ptr>syze, error(ptr" = ptr > syze = "syze,k5));
         arr[ptr]=0;      \\strike-out sieve elements
      );

      minn=a*10;    \\Feb 6 tweak
      for(l7=1,syze,
         elem=arr[l7];
         if(elem<minn && elem>a,minn=elem)  \\want lowest nonzero value NOT already setaside
      );  \\end FOR l7
      a=minn;
      \\write("c:\\Pari\\momo3.txt",minn," , ")
      v=concat(v,minn)

   );  \\end while
   v
};


This outputs a vector rather than dumping it to a file, which is more convenient for me. Of course most of my changes were just code organization -- making it easier for me to see what's going on. I don't know if this makes it easier for you or harder; feel free to take anything you like and leave the rest.

momo: Feel free to take whichever program you prefer -- whichever makes more sense to you -- if you want a copy to run on your computer. I don't think I improved the runtime on this version, so if billymac's style makes more sense to you, by all means use it rather than this.
User avatar
CRGreathouse
Joker
Joker
 
Posts: 5300
Joined: Sat Nov 25, 2006 9:52 am
Location: UTC -5

Re: New sequence : parallel "prime"

Postby momo » Sun Feb 07, 2010 10:29 am

CRGreathouse wrote:
momo wrote:You have to read the last posts.
The algorithm was yet sent.


Sorry, I must have missed it in the flurry of posts.

momo wrote:I'm sorry I did a miscalculation.
I have to review the algorithm but it is not wrong in theory.
I"m tired now.
I go to sleep.
Tomorrow I will correct it.
You can correct it if you undesrstood the principle.


I do not understand the principle, but I'll look over the algorithm when you correct it (tomorrow or whenever is convenient).


Hi,

I did not sleep yesterday. In fact the problem is more harder than I first thought.
So my last algo is not working.
To determine if a number n is parallel prime will not be easy.
Have good week end.
I'm going to stop posting one or two days (Pari/gp is very interesting).

Thank you for all your comments.
momo
Joker
Joker
 
Posts: 601
Joined: Sun Nov 18, 2007 5:34 pm

Re: New sequence : parallel "prime"

Postby CRGreathouse » Sun Feb 07, 2010 1:05 pm

momo wrote:I'm going to stop posting one or two days (Pari/gp is very interesting).


It is! Feel free to start a post (here or on Math Software) about using Pari, if you run into any issues.
User avatar
CRGreathouse
Joker
Joker
 
Posts: 5300
Joined: Sat Nov 25, 2006 9:52 am
Location: UTC -5

Re: New sequence : parallel "prime"

Postby momo » Mon Feb 08, 2010 10:39 pm

Hi,

For now I did not find the solution for the question : is n parallel prime or not?
Because I have the first few values U(n) :
1,2,5,8,9,12,20,24,27,30,31,42,48,60,61,72,76,93,94,100,118,122,133,156,163...

I had discovered some pattern some regularities but it is not helpful.
n is not parallel prime if :

n=U(k) +s*(s+1)/2 - 1

where U(k) is a parallel prime and s natural number

I need a bigger list (at least 1000).

Help!!!
momo
Joker
Joker
 
Posts: 601
Joined: Sun Nov 18, 2007 5:34 pm

Re: New sequence : parallel "prime"

Postby CRGreathouse » Mon Feb 08, 2010 11:40 pm

That property follows directly from your definition.
User avatar
CRGreathouse
Joker
Joker
 
Posts: 5300
Joined: Sat Nov 25, 2006 9:52 am
Location: UTC -5

Re: New sequence : parallel "prime"

Postby momo » Tue Feb 09, 2010 12:02 am

CRGreathouse wrote:That property follows directly from your definition.


It is obvious that it is a consequence of my definition.
But I need more longer list to try to estimate s and U(k).
I did it for three to four digit numbers and it is not sure that for big numbers my idea will hold.
There are some bounds to compute.
momo
Joker
Joker
 
Posts: 601
Joined: Sun Nov 18, 2007 5:34 pm

Re: New sequence : parallel "prime"

Postby CRGreathouse » Tue Feb 09, 2010 12:16 am

Well, perhaps billymac will adapt his program for you.
User avatar
CRGreathouse
Joker
Joker
 
Posts: 5300
Joined: Sat Nov 25, 2006 9:52 am
Location: UTC -5

Re: New sequence : parallel "prime"

Postby billymac00 » Tue Feb 09, 2010 6:37 am

CRGreathouse wrote:Well, perhaps billymac will adapt his program for you.


naah, I've used up time allotment on this, I am studying for my PE, must stay focused!
billymac00
King of Diamonds
King of Diamonds
 
Posts: 218
Joined: Sun Aug 17, 2008 9:28 am
Location: Northern Calif USA

Re: New sequence : parallel "prime"

Postby momo » Tue Feb 09, 2010 12:13 pm

billymac00 wrote:
CRGreathouse wrote:Well, perhaps billymac will adapt his program for you.


naah, I've used up time allotment on this, I am studying for my PE, must stay focused!


Hi,

I know you are busy but in this case you have to replace in your program the sequence prime 2.3.5.7....p by 2,3,4,5,6,7,8,.....n.
So I do not think that it is going to take you more than one minute.
Thank you if you can send it to me by PM.
You can also use Rapidshare
http://rapidshare.de/
You can upload up to 100 mega

Thank you!
momo
Joker
Joker
 
Posts: 601
Joined: Sun Nov 18, 2007 5:34 pm

Re: New sequence : parallel "prime"

Postby CRGreathouse » Tue Feb 09, 2010 1:35 pm

billymac00 wrote:naah, I've used up time allotment on this, I am studying for my PE, must stay focused!


Professional Engineer? Good luck with that, we're all rooting for you. 8)
User avatar
CRGreathouse
Joker
Joker
 
Posts: 5300
Joined: Sat Nov 25, 2006 9:52 am
Location: UTC -5

Re: New sequence : parallel "prime"

Postby billymac00 » Tue Feb 09, 2010 4:09 pm

OK, DONE as per request. the rapid share says link was [url]http://rapidshare.de/files/49127070/momonp.txt.html/url]
delete when done. this one is 461 data points, I'll let it run longer soon to get you 1000.
billymac00
King of Diamonds
King of Diamonds
 
Posts: 218
Joined: Sun Aug 17, 2008 9:28 am
Location: Northern Calif USA

Re: New sequence : parallel "prime"

Postby momo » Tue Feb 09, 2010 4:19 pm

billymac00 wrote:OK, DONE as per request. the rapid share says link was [url]http://rapidshare.de/files/49127070/momonp.txt.html/url]
delete when done. this one is 461 data points, I'll let it run longer soon to get you 1000.


BIG BIG THANX!!!
:D :D :D :D :D :D :D :D
momo
Joker
Joker
 
Posts: 601
Joined: Sun Nov 18, 2007 5:34 pm

Re: New sequence : parallel "prime"

Postby momo » Tue Feb 09, 2010 4:20 pm

This night I'm going to work on the file
momo
Joker
Joker
 
Posts: 601
Joined: Sun Nov 18, 2007 5:34 pm

Re: New sequence : parallel "prime"

Postby billymac00 » Tue Feb 09, 2010 6:28 pm

momo wrote:This night I'm going to work on the file


Ok, here's better (longer) file, use it instead please...think it has 1443 entries...
[url]http://rapidshare.de/files/49127804/momonp2.txt.html/url]
billymac00
King of Diamonds
King of Diamonds
 
Posts: 218
Joined: Sun Aug 17, 2008 9:28 am
Location: Northern Calif USA

PreviousNext

Return to Number Theory

Who is online

Registered users: Baidu [Spider], NeuroFuzzy, The Chaz, Yahoo [Bot]