mersenneforum.org found before ?
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

 2010-04-23, 22:15 #1 science_man_88     "Forget I exist" Jul 2009 Dumbassville 26·131 Posts found before ? (19:10) gp > a=0;for(x=1,1000,if(isprime(x) && (isprime(x+2) || isprime(x-2)),a=a+1;print1(x%10","))) 3,5,7,1,3,7,9,9,1,1,3,9,1,1,3,1,3,7,9,7,9,9,1,9,1,1,3,7,9,7,9,9,1,9,1,1,3,1,3,7,9,9,1,1,3,1,3,1,3,9,1,9,1,7,9,1,3,9,1,9,1,1,3,7,9,7,9,1,3 Last fiddled with by science_man_88 on 2010-04-23 at 22:24
 2010-04-24, 01:09 #2 kar_bon     Mar 2006 Germany 33×107 Posts As I PM'ed you yesterday, try to explain what you want to show! A line of PARI-code and some digits won't understand anyone without a (very) closer look! And the answer to you question above: yes, it's already known, better as Twin-Prime pairs. Your code only printed the last digit of every twin pair found from n=1 to 1000, nothing else! Those pairs in full digit expansion are: (3/5) (5/7) (11/13) (17/19) (29/31) (41/43) (59/61) (71/73) (101/103) (107/109) and so on. Take the rightmost digit of every number here and you got your sequence! So why do you ask others, if they know something without finding out such things by yourself with some more inverstigations? Don't try to find a PARI-code for all your minds, better learn to explain things in correct math notation. And if you give such code, you have to understand it. Think again, what your code does! Looking for a prime and determin if the neighbour is also prime, so a twin prime pair! Nothing new, sorry! PS: Your variable 'a' should be 35 after the 'for'-loop! Last fiddled with by kar_bon on 2010-04-24 at 01:29
 2010-04-24, 01:56 #3 science_man_88     "Forget I exist" Jul 2009 Dumbassville 26·131 Posts yes well have you looked at the bold and italic and underlined sequences they are repeats of each other and yes I realize there are more that should be highlighted in some way. kar_bon I knew they were twin primes last digits and apparently I know less than all people on here. second it's not the twin primes them selves but predicting the last digit by using this that I was interested in. Last fiddled with by science_man_88 on 2010-04-24 at 02:00
2010-04-24, 02:13   #4
CRGreathouse

Aug 2006

10111011000012 Posts

Hint: Instead of writing
Code:
for(x=a,b,if(isprime(x)&..., ...))
write
Code:
forprime(x=a,b,if(...,...))
It's faster and easier to read. I prefer to use p, q, r, and s (in that order) as prime indices, rather than x; but that's personal preference.

Quote:
 Originally Posted by science_man_88 yes well have you looked at the bold and italic and underlined sequences they are repeats of each other and yes I realize there are more that should be highlighted in some way. kar_bon I knew they were twin primes last digits and apparently I know less than all people on here. second it's not the twin primes them selves but predicting the last digit by using this that I was interested in.
Can you be specific about your prediction?

 2010-04-24, 11:18 #5 science_man_88     "Forget I exist" Jul 2009 Dumbassville 26·131 Posts well CRG I was to use the re occurrences to help predict the next possible last digit in some way like is highlighted 9113 repeats at least 6 times mind you they all do but maybe it's something about a order pattern or a formula to guess more easily. One thing I see is 79 is usually right in front or right behind 9113 which is usually from an overlap (for behind) of 1379 or 1379 being in front of it the one major exception i see here is when 7991 got in between when 1379 was in front. Last fiddled with by science_man_88 on 2010-04-24 at 11:28
 2010-04-24, 15:57 #6 Jens K Andersen     Feb 2006 Denmark 3468 Posts The only possible ending digits in twin prime pairs above 10 are 13, 79, 91. I see no reason to expect anything other than a random looking sequence of these for large twin primes. A small sample of twin primes may have certain patterns occuring more frequently than others but that's not a reason to think a pattern for long intervals have been found. If you want to look for a pattern anyway then I suggest to only examine the ending digit in one of p and p+2, since that identifies the other.
2010-04-24, 16:13   #7
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts

Quote:
 Originally Posted by CRGreathouse Hint: Instead of writing Code: for(x=a,b,if(isprime(x)&..., ...)) write Code: forprime(x=a,b,if(...,...)) It's faster and easier to read. I prefer to use p, q, r, and s (in that order) as prime indices, rather than x; but that's personal preference. Can you be specific about your prediction?
(13:11) gp > forprime(x=a,b,if(...,...))
*** forprime: incorrect type in prime_loop_init.
(13:11) gp > forprime(x=1,100,if(...,...))
*** unknown member function: if(...,...))
^-------
(13:11) gp > forprime(x=1,100,if(,))
*** unexpected character: forprime(x=1,100,if(,))
^---
(13:11) gp > forprime(x=1,100,if())
*** unexpected character: forprime(x=1,100,if())
^--
(13:11) gp > forprime(x=1,100,)
(13:11) gp >

2010-04-24, 16:22   #8
CRGreathouse

Aug 2006

32·5·7·19 Posts

Quote:
 Originally Posted by Jens K Andersen A small sample of twin primes may have certain patterns occuring more frequently than others but that's not a reason to think a pattern for long intervals have been found.
I don't think there's any reason to find such a pattern, but I'd like to see what science_man_88 comes up with. Actually, if he can make a concrete, testable prediction I would consider that as a success of itself.

Quote:
 Originally Posted by science_man_88 One thing I see is 79 is usually right in front or right behind 9113
So make this specific. Consider all occurrences of 9,1,1,3 in this sequence. Do you think that 7,9 comes either before or after (or both) it at least 90% of the time? 75%? For all but, say, 100 times?

2010-04-24, 16:24   #9
CRGreathouse

Aug 2006

32×5×7×19 Posts

Quote:
 Originally Posted by science_man_88 (13:11) gp > forprime(x=a,b,if(...,...)) *** forprime: incorrect type in prime_loop_init.
You'd need to put something in place of the ..., of course. For example:
Code:
forprime(p=2,1e3,if(isprime(2*p+1),print1(p",")))
gives the Sophie Germain primes.

 2010-04-24, 17:45 #10 Jens K Andersen     Feb 2006 Denmark 2×5×23 Posts Your original code with forprime and without the unused a would be: Code: forprime(x=1,1000,if((isprime(x+2) || isprime(x-2)),print1(x%10","))) For visual pattern examination I would skip the larger prime in a pair and the comma: Code: forprime(x=1,2000,if(isprime(x+2),print1(x%10))) Output: Code: 3517919117799177991179111997199177191911197919711779771717197 A short sequence will usually have some things repeating more often than others but I don't expect any recognizable pattern in a much longer sequence. If you want to do serious research then you have to make a program to count different occurrences over a much longer interval than anybody would count manually. I wouldn't personally post an analysis of anything below an interval up to 10^12 but I can program in C and often recompute the primes to 10^12 or more (there are too many to store for me). In PARI/GP you may have to settle with less if you want results in a reasonable time.
2010-04-24, 18:40   #11
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts

Quote:
 3,5,7,1,3,7,9,9,1,1,3,9,1,1,3,1,3,7,9,7,9,9,1,9,1,1,3,7,9,7,9,9,1,9,1,1,3,1,3,7,9,9,1,1,3,1,3,1,3,9,1,9,1,7,9,1,3,9,1,9,1,1,3,7,9,7,9,1,3,9,1,1,3,9,1,1,3,1,3,1,3,9,1,7,9,9,1,1,3,9,1,7,9,1,3,1,3,7,9,7,9,9,1,7,9,7,9,1,3,7,9,1,3,7,9,1,3,9,1,7,9,7,9,1,3,7,9,1,3,9,1,1,3,7,9,7,9,9,1,9,1,1,3,9,1,1,3,7,9,7,9,1,3,9,1,9,1,1,3,9,1,9,1,9,1,7,9,1,3,7,9,9,1,9,1,9,1,1,3,9,1,1,3,7,9,7,9,9,1,7,9,1,3,1,3,7,9,1,3,1,3,7,9,9,1,1,3,9,1,9,1,1,3,7,9,7,9,7,9,9,1,1,3,9,1,1,3,7,9,1,3,1,3,7,9,7,9,7,9,9,1,1,3,7,9,9,1,1,3,7,9,9,1,1,3,9,1,1,3,9,1,7,9,1,3,7,9,1,3,9,1,9,1,1,3,7,9,1,3,9,1,7,9,9,1,9,1,1,3,7,9,9,1,9,1,9,1,9,1,1,3,9,1,9,1,9,1,1,3,1,3,9,1,1,3,7,9,9,1,7,9,9,1,7,9,1,3,7,9,1,3,9,1,7,9,7,9,7,9,9,1,9,1,7,9,7,9,9,1,9,1,7,9,9,1,1,3,1,3,7,9,9,1,7,9,7,9,7,9,9,1,7,9,1,3,9,1,9,1,1,3,1,3,9,1,1,3,1,3,9,1,1,3,7,9,1,3,9,1,7,9,9,1,7,9,7,9,9,1,
this of any more help CRG ? I went back and found a few more of the ones highlighted with underline color and bold (which i can't detect in code)

Last fiddled with by science_man_88 on 2010-04-24 at 18:55

 Similar Threads Thread Thread Starter Forum Replies Last Post tha Data 65 2020-08-05 21:11 jord161 PrimeNet 10 2018-06-22 21:57 ltd Prime Sierpinski Project 12 2008-07-31 17:29 em99010pepe ElevenSmooth 8 2006-01-02 10:12 Unregistered Data 1 2005-02-19 18:20

All times are UTC. The time now is 10:08.

Mon May 17 10:08:53 UTC 2021 up 39 days, 4:49, 0 users, load averages: 1.75, 1.46, 1.43