![]() |
|
|
#1 |
|
"Forget I exist"
Jul 2009
Dartmouth NS
8,461 Posts |
(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 |
|
|
|
|
|
#2 |
|
Mar 2006
Germany
2·1,531 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 |
|
|
|
|
|
#3 |
|
"Forget I exist"
Jul 2009
Dartmouth NS
8,461 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 |
|
|
|
|
|
#4 | |
|
Aug 2006
22·3·499 Posts |
Hint: Instead of writing
Code:
for(x=a,b,if(isprime(x)&..., ...)) Code:
forprime(x=a,b,if(...,...)) Quote:
|
|
|
|
|
|
|
#5 |
|
"Forget I exist"
Jul 2009
Dartmouth NS
8,461 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 |
|
|
|
|
|
#6 |
|
Feb 2006
Denmark
2·5·23 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.
|
|
|
|
|
|
#7 | |
|
"Forget I exist"
Jul 2009
Dartmouth NS
8,461 Posts |
Quote:
*** 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 > |
|
|
|
|
|
|
#8 | |
|
Aug 2006
22×3×499 Posts |
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? |
|
|
|
|
|
|
#9 |
|
Aug 2006
135448 Posts |
|
|
|
|
|
|
#10 |
|
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","))) Code:
forprime(x=1,2000,if(isprime(x+2),print1(x%10))) Code:
3517919117799177991179111997199177191911197919711779771717197 |
|
|
|
|
|
#11 | |
|
"Forget I exist"
Jul 2009
Dartmouth NS
210D16 Posts |
Quote:
Last fiddled with by science_man_88 on 2010-04-24 at 18:55 |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Factor found that should have been found by P-1 | tha | Data | 65 | 2020-08-05 21:11 |
| found one! what do I do now? | jord161 | PrimeNet | 10 | 2018-06-22 21:57 |
| New PRP found | ltd | Prime Sierpinski Project | 12 | 2008-07-31 17:29 |
| Found something here | em99010pepe | ElevenSmooth | 8 | 2006-01-02 10:12 |
| M42 found? | Unregistered | Data | 1 | 2005-02-19 18:20 |