mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Twin Prime Search (https://www.mersenneforum.org/forumdisplay.php?f=65)
-   -   found before ? (https://www.mersenneforum.org/showthread.php?t=13346)

science_man_88 2010-04-23 22:15

found before ?
 
[COLOR="red"](19:10) gp >[/COLOR] a=0;for(x=1,1000,if(isprime(x) && (isprime(x+2) || isprime(x-2)),a=a+1;print1(x%10",")))
3,5,7,[I]1,3,7,9[/I],[B]9,1,1,3[/B],[B]9,1,1,3[/B],[I]1,3,7,9[/I],[U]7,9,9,1[/U],[B]9,1,1,3[/B],7,9,[U]7,9,9,1[/U],[B]9,1,1,3[/B],[I]1,3,7,9[/I],[B]9,1,1,3[/B],1,3,1,3,9,1,9,1,7,9,1,3,9,1,[B]9,1,1,3[/B],7,9,7,9,1,3

kar_bon 2010-04-24 01:09

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!

science_man_88 2010-04-24 01:56

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.

CRGreathouse 2010-04-24 02:13

Hint: Instead of writing
[code]for(x=a,b,if(isprime(x)&..., ...))[/code]
write
[code]forprime(x=a,b,if(...,...))[/code]

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=science_man_88;213009]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.[/QUOTE]

Can you be specific about your prediction?

science_man_88 2010-04-24 11:18

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 [B]usually[/B] 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.

Jens K Andersen 2010-04-24 15:57

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.

science_man_88 2010-04-24 16:13

[QUOTE=CRGreathouse;213011]Hint: Instead of writing
[code]for(x=a,b,if(isprime(x)&..., ...))[/code]
write
[code]forprime(x=a,b,if(...,...))[/code]

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?[/QUOTE]

(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 >

CRGreathouse 2010-04-24 16:22

[QUOTE=Jens K Andersen;213048]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.[/QUOTE]

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=science_man_88;213031]One thing I see is 79 is [B]usually[/B] right in front or right behind 9113[/QUOTE]

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?

CRGreathouse 2010-04-24 16:24

[QUOTE=science_man_88;213052](13:11) gp > forprime(x=a,b,if(...,...))
*** forprime: incorrect type in prime_loop_init.[/QUOTE]

:no: 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",")))[/code]
gives the Sophie Germain primes.

Jens K Andersen 2010-04-24 17:45

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",")))[/CODE]
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)))[/CODE]
Output:
[CODE]3517919117799177991179111997199177191911197919711779771717197[/CODE]
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.

science_man_88 2010-04-24 18:40

[QUOTE]3,5,7,[B]1,3,[U]7,9[/B],[COLOR="DarkOrange"]9,1[/U],1,3[/COLOR],[COLOR="DarkOrange"]9,1,1,3[/COLOR],[B]1,3,7,9[/B],[U]7,9,9,1[/U],[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],7,9[/B],[U]7,9,9,1[/U],[COLOR="DarkOrange"]9,1,1,3[/COLOR],[B]1,3,[U]7,9[/B],[COLOR="DarkOrange"]9,1[/U],1,3[/COLOR],1,3,1,3,9,1,9,1,7,9,1,3,9,1,[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],7,9[/B],7,9,1,3,[COLOR="DarkOrange"]9,1,1,3[/COLOR],[COLOR="DarkOrange"]9,1,1,3[/COLOR],1,3,1,3,9,1,[U]7,9,[COLOR="DarkOrange"]9,1[/U],1,3[/COLOR],9,1,7,9,1,3,[B]1,3,7,9[/B],[U]7,9,9,1[/U],7,9,7,9,[B]1,3,7,9[/B],[B]1,3,7,9[/B],1,3,9,1,7,9,7,9,[B]1,3,7,9[/B],1,3,[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],7,9[/B],[U]7,9,9,1[/U],[COLOR="DarkOrange"]9,1,1,3[/COLOR],[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],7,9[/B],7,9,1,3,9,1,[COLOR="DarkOrange"]9,1,1,3[/COLOR],9,1,9,1,9,1,7,9,[B]1,3,[U]7,9[/B],9,1[/U],9,1,[COLOR="DarkOrange"]9,1,1,3[/COLOR],[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],7,9[/B],[U]7,9,9,1[/U],7,9,1,3,[B]1,3,7,9[/B],1,3,[B]1,3,[U]7,9[/B],[COLOR="DarkOrange"]9,1[/U],1,3[/COLOR],9,1,[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],7,9[/B],7,9,[U]7,9,[COLOR="DarkOrange"]9,1[/U],1,3,[/COLOR]9,1,[B]1,3,7,9[/B],1,3,[B]1,3,7,9[/B],7,9,[U]7,9,9,1[/U],[B]1,3,7,9[/B],9,1,[B]1,3,[U]7,9[/B],[COLOR="DarkOrange"]9,1[/U],1,3[/COLOR],[COLOR="DarkOrange"]9,1,1,3[/COLOR],9,1,7,9,1[B],3,7,9[/B],1,3,9,1,[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],7,9[/B],1,3,9,1,[U]7,9,9,1[/U],[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],[U]7,9[/B],9,1[/U],9,1,9,1,[COLOR="DarkOrange"]9,1,1,3[/COLOR],9,1,9,1,[COLOR="DarkOrange"]9,1,1,3[/COLOR],1,3,[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],[U]7,9[/B],9,1[/U],[U]7,9,9,1[/U],7,9,[B]1,3,7,9,[/B]1,3,9,1,7,9,7,9,[U]7,9,9,1[/U],9,1,7,9,[U]7,9,9,1[/U],9,1,[U]7,9,[COLOR="DarkOrange"]9,1[/U],1,3[/COLOR],[B]1,3,[U]7,9[/B],9,1[/U],7,9,7,9,[U]7,9,9,1[/U],7,9,1,3,9,1,[COLOR="DarkOrange"]9,1,1,3[/COLOR],1,3,[COLOR="DarkOrange"]9,1,1,3[/COLOR],1,3,[COLOR="DarkOrange"]9,1,[B]1,3[/COLOR],7,9[/B],1,3,9,1,[U]7,9,9,1[/U],7,9,[U]7,9,9,1[/U],[/QUOTE]

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)


All times are UTC. The time now is 13:35.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.