2022-02-21, 16:28 | #1 |
"Matthew Anderson"
Dec 2010
Oregon, USA
3×17×23 Posts |
Matt's 10 tuple thread
Hi again everybody,
I modified my prime sets procedure. Now it can handle 10 tuples. I did not test it a lot, but it seems to be functional. I will repeat my challenge. If anyone can give me a windows executable of this code, I will pay you $10 USD. I'm sure that there are some takers out there. Have a nice day. Matthew Last fiddled with by Dr Sardonicus on 2022-02-21 at 20:14 Reason: Remove bloated image file of plain text |
2022-02-21, 23:45 | #2 |
"Matthew Anderson"
Dec 2010
Oregon, USA
3·17·23 Posts |
10-tuples or less.
Maple student stopped working at my 8-tuple. So this is what you have the privilege of looking at.
Code:
tuple10 := proc (diff1, diff2, diff3, diff4, diff5, diff6, diff7, diff8, diff9, diff10) local a, counter, searchstop; counter := 1; searchstop := 9000; for a from 3 by 2 to searchstop do if isprime(a) and isprime(a+diff1) and isprime(a+diff2) and isprime(a+diff3) and isprime(a+diff4) and isprime(a+diff5) and isprime(a+diff6) and isprime(a+diff7) and isprime(a+diff8) and isprime(a+diff9) and isprime(a+diff10) then print(counter, "hourah!! we found a set", a, " ", a+diff1, " ", a+diff2, a+diff3, a+diff4, a+diff5, a+diff6, a+diff7, a+diff8, a+diff9, a+diff10); counter := counter+1 end if end do end proc Code:
> NULL; > tuple10(12, 0, 0, 0, 0, 0, 0, 0, 0, 0); 1, "hourah!! we found a set", 5, " ", 17, " ", 5, 5, 5, 5, 5, 5, 5, 5, 5 2, "hourah!! we found a set", 7, " ", 19, " ", 7, 7, 7, 7, 7, 7, 7, 7, 7 3, "hourah!! we found a set", 11, " ", 23, " ", 11, 11, 11, 11, 11, 11, 11, 11, 11 4, "hourah!! we found a set", 17, " ", 29, " ", 17, 17, 17, 17, 17, 17, 17, 17, 17 5, "hourah!! we found a set", 19, " ", 31, " ", 19, 19, 19, 19, 19, 19, 19, 19, 19 6, "hourah!! we found a set", 29, " ", 41, " ", 29, 29, 29, 29, 29, 29, 29, 29, 29 7, "hourah!! we found a set", 31, " ", 43, " ", 31, 31, 31, 31, 31, 31, 31, 31, 31 8, "hourah!! we found a set", 41, " ", 53, " ", 41, 41, 41, 41, 41, 41, 41, 41, 41 9, "hourah!! we found a set", 47, " ", 59, " ", 47, 47, 47, 47, 47, 47, 47, 47, 47 10, "hourah!! we found a set", 59, " ", 71, " ", 59, 59, 59, 59, 59, 59, 59, 59, 59 11, "hourah!! we found a set", 61, " ", 73, " ", 61, 61, 61, 61, 61, 61, 61, 61, 61 12, "hourah!! we found a set", 67, " ", 79, " ", 67, 67, 67, 67, 67, 67, 67, 67, 67 13, "hourah!! we found a set", 71, " ", 83, " ", 71, 71, 71, 71, 71, 71, 71, 71, 71 14, "hourah!! we found a set", 89, " ", 101, " ", 89, 89, 89, 89, 89, 89, 89, 89, 89 15, "hourah!! we found a set", 97, " ", 109, " ", 97, 97, 97, 97, 97, 97, 97, 97, 97 16, "hourah!! we found a set", 101, " ", 113, " ", 101, 101, 101, 101, 101, 101, 101, 101, 101 17, "hourah!! we found a set", 127, " ", 139, " ", 127, 127, 127, 127, 127, 127, 127, 127, 127 18, "hourah!! we found a set", 137, " ", 149, " ", 137, 137, 137, 137, 137, 137, 137, 137, 137 19, "hourah!! we found a set", 139, " ", 151, " ", 139, 139, 139, 139, 139, 139, 139, 139, 139 20, "hourah!! we found a set", 151, " ", 163, " ", 151, 151, 151, 151, 151, 151, 151, 151, 151 21, "hourah!! we found a set", 167, " ", 179, " ", 167, 167, 167, 167, 167, 167, 167, 167, 167 Now for some 3,4,5,6,7 and an 8-tuple. Code:
> NULL; > tuple10(12, 14, 18, 0, 0, 0, 0, 0, 0, 0); 1, "hourah!! we found a set", 5, " ", 17, " ", 19, 23, 5, 5, 5, 5, 5, 5, 5 2, "hourah!! we found a set", 29, " ", 41, " ", 43, 47, 29, 29, 29, 29, 29, 29, 29 3, "hourah!! we found a set", 89, " ", 101, " ", 103, 107, 89, 89, 89, 89, 89, 89, 89 4, "hourah!! we found a set", 179, " ", 191, " ", 193, 197, 179, 179, 179, 179, 179, 179, 179 5, "hourah!! we found a set", 449, " ", 461, " ", 463, 467, 449, 449, 449, 449, 449, 449, 449 6, "hourah!! we found a set", 809, " ", 821, " ", 823, 827, 809, 809, 809, 809, 809, 809, 809 7, "hourah!! we found a set", 1289, " ", 1301, " ", 1303, 1307, 1289, 1289, 1289, 1289, 1289, 1289, 1289 8, "hourah!! we found a set", 2069, " ", 2081, " ", 2083, 2087, 2069, 2069, 2069, 2069, 2069, 2069, 2069 9, "hourah!! we found a set", 3449, " ", 3461, " ", 3463, 3467, 3449, 3449, 3449, 3449, 3449, 3449, 3449 10, "hourah!! we found a set", 3659, " ", 3671, " ", 3673, 3677, 3659, 3659, 3659, 3659, 3659, 3659, 3659 11, "hourah!! we found a set", 3989, " ", 4001, " ", 4003, 4007, 3989, 3989, 3989, 3989, 3989, 3989, 3989 12, "hourah!! we found a set", 4919, " ", 4931, " ", 4933, 4937, 4919, 4919, 4919, 4919, 4919, 4919, 4919 13, "hourah!! we found a set", 5639, " ", 5651, " ", 5653, 5657, 5639, 5639, 5639, 5639, 5639, 5639, 5639 14, "hourah!! we found a set", 8219, " ", 8231, " ", 8233, 8237, 8219, 8219, 8219, 8219, 8219, 8219, 8219 15, "hourah!! we found a set", 8849, " ", 8861, " ", 8863, 8867, 8849, 8849, 8849, 8849, 8849, 8849, 8849 > NULL; > NULL; > tuple10(12, 14, 18, 24, 0, 0, 0, 0, 0, 0); 1, "hourah!! we found a set", 5, " ", 17, " ", 19, 23, 29, 5, 5, 5, 5, 5, 5 2, "hourah!! we found a set", 29, " ", 41, " ", 43, 47, 53, 29, 29, 29, 29, 29, 29 3, "hourah!! we found a set", 89, " ", 101, " ", 103, 107, 113, 89, 89, 89, 89, 89, 89 4, "hourah!! we found a set", 3989, " ", 4001, " ", 4003, 4007, 4013, 3989, 3989, 3989, 3989, 3989, 3989 5, "hourah!! we found a set", 4919, " ", 4931, " ", 4933, 4937, 4943, 4919, 4919, 4919, 4919, 4919, 4919 6, "hourah!! we found a set", 8219, " ", 8231, " ", 8233, 8237, 8243, 8219, 8219, 8219, 8219, 8219, 8219 > NULL; > NULL; > tuple10(12, 14, 18, 24, 36, 0, 0, 0, 0, 0); 1, "hourah!! we found a set", 5, " ", 17, " ", 19, 23, 29, 41, 5, 5, 5, 5, 5 > NULL; > NULL; > tuple10(12, 14, 18, 24, 36, 84, 0, 0, 0, 0); 1, "hourah!! we found a set", 5, " ", 17, " ", 19, 23, 29, 41, 89, 5, 5, 5, 5 > NULL; > NULL; > tuple10(12, 14, 18, 24, 36, 84, 144, 0, 0, 0); 1, "hourah!! we found a set", 5, " ", 17, " ", 19, 23, 29, 41, 89, 149, 5, 5, 5 > NULL; Have a nice day. |
2022-02-22, 04:19 | #3 |
"Matthew Anderson"
Dec 2010
Oregon, USA
3·17·23 Posts |
more k-tuple fun
> # Here is a 4-tuple
Code:
> NULL; > tuple10(12, 14, 0, 0, 0, 0, 0, 0, 0, 2); 1, "hourah!! we found a set", 5, " ", 17, " ", 19, 5, 5, 5, 5, 5, 5, 5, 7 2, "hourah!! we found a set", 17, " ", 29, " ", 31, 17, 17, 17, 17, 17, 17, 17, 19 3, "hourah!! we found a set", 29, " ", 41, " ", 43, 29, 29, 29, 29, 29, 29, 29, 31 4, "hourah!! we found a set", 59, " ", 71, " ", 73, 59, 59, 59, 59, 59, 59, 59, 61 5, "hourah!! we found a set", 137, " ", 149, " ", 151, 137, 137, 137, 137, 137, 137, 137, 139 6, "hourah!! we found a set", 179, " ", 191, " ", 193, 179, 179, 179, 179, 179, 179, 179, 181 7, "hourah!! we found a set", 227, " ", 239, " ", 241, 227, 227, 227, 227, 227, 227, 227, 229 8, "hourah!! we found a set", 269, " ", 281, " ", 283, 269, 269, 269, 269, 269, 269, 269, 271 9, "hourah!! we found a set", 419, " ", 431, " ", 433, 419, 419, 419, 419, 419, 419, 419, 421 10, "hourah!! we found a set", 809, " ", 821, " ", 823, 809, 809, 809, 809, 809, 809, 809, 811 11, "hourah!! we found a set", 1019, " ", 1031, " ", 1033, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1021 12, "hourah!! we found a set", 1049, " ", 1061, " ", 1063, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1051 13, "hourah!! we found a set", 1277, " ", 1289, " ", 1291, 1277, 1277, 1277, 1277, 1277, 1277, 1277, 1279 14, "hourah!! we found a set", 1289, " ", 1301, " ", 1303, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1291 15, "hourah!! we found a set", 1607, " ", 1619, " ", 1621, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1609 16, "hourah!! we found a set", 2129, " ", 2141, " ", 2143, 2129, 2129, 2129, 2129, 2129, 2129, 2129, 2131 17, "hourah!! we found a set", 2789, " ", 2801, " ", 2803, 2789, 2789, 2789, 2789, 2789, 2789, 2789, 2791 18, "hourah!! we found a set", 3359, " ", 3371, " ", 3373, 3359, 3359, 3359, 3359, 3359, 3359, 3359, 3361 19, "hourah!! we found a set", 3527, " ", 3539, " ", 3541, 3527, 3527, 3527, 3527, 3527, 3527, 3527, 3529 20, "hourah!! we found a set", 3917, " ", 3929, " ", 3931, 3917, 3917, 3917, 3917, 3917, 3917, 3917, 3919 21, "hourah!! we found a set", 4217, " ", 4229, " ", 4231, 4217, 4217, 4217, 4217, 4217, 4217, 4217, 4219 22, "hourah!! we found a set", 4229, " ", 4241, " ", 4243, 4229, 4229, 4229, 4229, 4229, 4229, 4229, 4231 23, "hourah!! we found a set", 4259, " ", 4271, " ", 4273, 4259, 4259, 4259, 4259, 4259, 4259, 4259, 4261 24, "hourah!! we found a set", 4637, " ", 4649, " ", 4651, 4637, 4637, 4637, 4637, 4637, 4637, 4637, 4639 25, "hourah!! we found a set", 4787, " ", 4799, " ", 4801, 4787, 4787, 4787, 4787, 4787, 4787, 4787, 4789 26, "hourah!! we found a set", 5009, " ", 5021, " ", 5023, 5009, 5009, 5009, 5009, 5009, 5009, 5009, 5011 27, "hourah!! we found a set", 5639, " ", 5651, " ", 5653, 5639, 5639, 5639, 5639, 5639, 5639, 5639, 5641 28, "hourah!! we found a set", 5867, " ", 5879, " ", 5881, 5867, 5867, 5867, 5867, 5867, 5867, 5867, 5869 29, "hourah!! we found a set", 6689, " ", 6701, " ", 6703, 6689, 6689, 6689, 6689, 6689, 6689, 6689, 6691 30, "hourah!! we found a set", 6779, " ", 6791, " ", 6793, 6779, 6779, 6779, 6779, 6779, 6779, 6779, 6781 31, "hourah!! we found a set", 6947, " ", 6959, " ", 6961, 6947, 6947, 6947, 6947, 6947, 6947, 6947, 6949 32, "hourah!! we found a set", 7547, " ", 7559, " ", 7561, 7547, 7547, 7547, 7547, 7547, 7547, 7547, 7549 33, "hourah!! we found a set", 8219, " ", 8231, " ", 8233, 8219, 8219, 8219, 8219, 8219, 8219, 8219, 8221 34, "hourah!! we found a set", 8999, " ", 9011, " ", 9013, 8999, 8999, 8999, 8999, 8999, 8999, 8999, 9001 35 > NULL; Code:
> tuple10(12, 14, 18, 0, 0, 0, 0, 0, 0, 0); 1, "hourah!! we found a set", 5, " ", 17, " ", 19, 23, 5, 5, 5, 5, 5, 5, 5 2, "hourah!! we found a set", 29, " ", 41, " ", 43, 47, 29, 29, 29, 29, 29, 29, 29 3, "hourah!! we found a set", 89, " ", 101, " ", 103, 107, 89, 89, 89, 89, 89, 89, 89 4, "hourah!! we found a set", 179, " ", 191, " ", 193, 197, 179, 179, 179, 179, 179, 179, 179 5, "hourah!! we found a set", 449, " ", 461, " ", 463, 467, 449, 449, 449, 449, 449, 449, 449 6, "hourah!! we found a set", 809, " ", 821, " ", 823, 827, 809, 809, 809, 809, 809, 809, 809 7, "hourah!! we found a set", 1289, " ", 1301, " ", 1303, 1307, 1289, 1289, 1289, 1289, 1289, 1289, 1289 8, "hourah!! we found a set", 2069, " ", 2081, " ", 2083, 2087, 2069, 2069, 2069, 2069, 2069, 2069, 2069 9, "hourah!! we found a set", 3449, " ", 3461, " ", 3463, 3467, 3449, 3449, 3449, 3449, 3449, 3449, 3449 10, "hourah!! we found a set", 3659, " ", 3671, " ", 3673, 3677, 3659, 3659, 3659, 3659, 3659, 3659, 3659 11, "hourah!! we found a set", 3989, " ", 4001, " ", 4003, 4007, 3989, 3989, 3989, 3989, 3989, 3989, 3989 12, "hourah!! we found a set", 4919, " ", 4931, " ", 4933, 4937, 4919, 4919, 4919, 4919, 4919, 4919, 4919 13, "hourah!! we found a set", 5639, " ", 5651, " ", 5653, 5657, 5639, 5639, 5639, 5639, 5639, 5639, 5639 14, "hourah!! we found a set", 8219, " ", 8231, " ", 8233, 8237, 8219, 8219, 8219, 8219, 8219, 8219, 8219 15, "hourah!! we found a set", 8849, " ", 8861, " ", 8863, 8867, 8849, 8849, 8849, 8849, 8849, 8849, 8849 > #A 5-tuple, that one |
2022-02-25, 09:38 | #4 |
"Matthew Anderson"
Dec 2010
Oregon, USA
3·17·23 Posts |
prime number pairs with difference of 82
Hi again everybody,
I know this is not the most earth shattering data set that I am about to post. But, I paid money to MersenneForum.org, and now I have a blog, and this is my hobby. So there. Procedure for 11-tuples or tuples with count less than 11. (1-tuples are good 'ol prime numbers). A procedure call to tuple10 with a searchstop value and everything else 0 will return a list of prime numbers. Again, I'm willing to pay someone for a translation of this into a Windows .exe file. I started trying fiverr.com, but no success so far. Code:
tuple10 := proc (searchstop, diff1, diff2, diff3, diff4, diff5, diff6, diff7, diff8, diff9, diff10) local a, counter; counter := 1; for a from 3 by 2 to searchstop do if isprime(a) and isprime(a+diff1) and isprime(a+diff2) and isprime(a+diff3) and isprime(a+diff4) and isprime(a+diff5) and isprime(a+diff6) and isprime(a+diff7) and isprime(a+diff8) and isprime(a+diff9) and isprime(a+diff10) then print(counter, "hourah!! we found a set", a, " ", a+diff1, " ", a+diff2, a+diff3, a+diff4, a+diff5, a+diff6, a+diff7, a+diff8, a+diff9, a+diff10); counter := counter+1 end if end do end proc; Code:
> tuple10(1000, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0); 1, "hourah!! we found a set", 7, " ", 89, " ", 7, 7, 7, 7, 7, 7, 7, 7, 7 2, "hourah!! we found a set", 19, " ", 101, " ", 19, 19, 19, 19, 19, 19, 19, 19, 19 3, "hourah!! we found a set", 31, " ", 113, " ", 31, 31, 31, 31, 31, 31, 31, 31, 31 4, "hourah!! we found a set", 67, " ", 149, " ", 67, 67, 67, 67, 67, 67, 67, 67, 67 5, "hourah!! we found a set", 97, " ", 179, " ", 97, 97, 97, 97, 97, 97, 97, 97, 97 6, "hourah!! we found a set", 109, " ", 191, " ", 109, 109, 109, 109, 109, 109, 109, 109, 109 7, "hourah!! we found a set", 151, " ", 233, " ", 151, 151, 151, 151, 151, 151, 151, 151, 151 8, "hourah!! we found a set", 157, " ", 239, " ", 157, 157, 157, 157, 157, 157, 157, 157, 157 9, "hourah!! we found a set", 181, " ", 263, " ", 181, 181, 181, 181, 181, 181, 181, 181, 181 10, "hourah!! we found a set", 199, " ", 281, " ", 199, 199, 199, 199, 199, 199, 199, 199, 199 11, "hourah!! we found a set", 211, " ", 293, " ", 211, 211, 211, 211, 211, 211, 211, 211, 211 12, "hourah!! we found a set", 229, " ", 311, " ", 229, 229, 229, 229, 229, 229, 229, 229, 229 13, "hourah!! we found a set", 271, " ", 353, " ", 271, 271, 271, 271, 271, 271, 271, 271, 271 14, "hourah!! we found a set", 277, " ", 359, " ", 277, 277, 277, 277, 277, 277, 277, 277, 277 15, "hourah!! we found a set", 307, " ", 389, " ", 307, 307, 307, 307, 307, 307, 307, 307, 307 16, "hourah!! we found a set", 337, " ", 419, " ", 337, 337, 337, 337, 337, 337, 337, 337, 337 17, "hourah!! we found a set", 349, " ", 431, " ", 349, 349, 349, 349, 349, 349, 349, 349, 349 18, "hourah!! we found a set", 367, " ", 449, " ", 367, 367, 367, 367, 367, 367, 367, 367, 367 19, "hourah!! we found a set", 379, " ", 461, " ", 379, 379, 379, 379, 379, 379, 379, 379, 379 20, "hourah!! we found a set", 397, " ", 479, " ", 397, 397, 397, 397, 397, 397, 397, 397, 397 21, "hourah!! we found a set", 409, " ", 491, " ", 409, 409, 409, 409, 409, 409, 409, 409, 409 22, "hourah!! we found a set", 421, " ", 503, " ", 421, 421, 421, 421, 421, 421, 421, 421, 421 23, "hourah!! we found a set", 439, " ", 521, " ", 439, 439, 439, 439, 439, 439, 439, 439, 439 24, "hourah!! we found a set", 487, " ", 569, " ", 487, 487, 487, 487, 487, 487, 487, 487, 487 25, "hourah!! we found a set", 571, " ", 653, " ", 571, 571, 571, 571, 571, 571, 571, 571, 571 26, "hourah!! we found a set", 577, " ", 659, " ", 577, 577, 577, 577, 577, 577, 577, 577, 577 27, "hourah!! we found a set", 601, " ", 683, " ", 601, 601, 601, 601, 601, 601, 601, 601, 601 28, "hourah!! we found a set", 619, " ", 701, " ", 619, 619, 619, 619, 619, 619, 619, 619, 619 29, "hourah!! we found a set", 661, " ", 743, " ", 661, 661, 661, 661, 661, 661, 661, 661, 661 30, "hourah!! we found a set", 691, " ", 773, " ", 691, 691, 691, 691, 691, 691, 691, 691, 691 31, "hourah!! we found a set", 727, " ", 809, " ", 727, 727, 727, 727, 727, 727, 727, 727, 727 32, "hourah!! we found a set", 739, " ", 821, " ", 739, 739, 739, 739, 739, 739, 739, 739, 739 33, "hourah!! we found a set", 757, " ", 839, " ", 757, 757, 757, 757, 757, 757, 757, 757, 757 34, "hourah!! we found a set", 829, " ", 911, " ", 829, 829, 829, 829, 829, 829, 829, 829, 829 35, "hourah!! we found a set", 859, " ", 941, " ", 859, 859, 859, 859, 859, 859, 859, 859, 859 36, "hourah!! we found a set", 937, " ", 1019, " ", 937, 937, 937, 937, 937, 937, 937, 937, 937 37, "hourah!! we found a set", 967, " ", 1049, " ", 967, 967, 967, 967, 967, 967, 967, 967, 967 As my old boss would say, "Good fun." Have a nice day. |
2022-02-25, 11:40 | #5 |
Mar 2006
Germany
5642_{8} Posts |
You could enhance your small codes by thinking of these:
- given 10 parameters diff1 to diff10 but if any diffx is zero do no print the value, so instead of "[...] print [...] a+diff2 [...]" do: if (diff2 <> 0) then a+diff2 end if - only print the value a, so you got a list like OEIS-style (nobody needs a "hourah,...") You could print a small text at beginning of the output do make clear, which tuples your're printing - and for one parameter diff1>0 but diff2 to diff10=0 you got 2-tuples with difference diff1, your example 82 but if you chose more parameters, say diff1=2 and diff2=6 you output a, a+2, a+6 but your're looking for a, a+2, a+2+6 Look at the RosettaCode category using maple to check for more examples. |
2022-02-26, 06:14 | #6 |
"Matthew Anderson"
Dec 2010
Oregon, USA
3·17·23 Posts |
Thanks kar_bon for the coding suggestions. I will try.
Here I use a variable 'searchstop' to determine list lengths as a passed parameter to my maple procedure. Small changes Code:
> NULL; > > tuple10 := proc (searchstop, diff1, diff2, diff3, diff4, diff5, diff6, diff7, diff8, diff9, diff10) local a, counter; counter := 1; for a from 3 by 2 to searchstop do if isprime(a) and isprime(a+diff1) and isprime(a+diff2) and isprime(a+diff3) and isprime(a+diff4) and isprime(a+diff5) and isprime(a+diff6) and isprime(a+diff7) and isprime(a+diff8) and isprime(a+diff9) and isprime(a+diff10) then print(counter, "hourah!! we found a set", a, " ", a+diff1, " ", a+diff2, a+diff3, a+diff4, a+diff5, a+diff6, a+diff7, a+diff8, a+diff9, a+diff10); counter := counter+1 end if end do end proc; proc(searchstop, diff1, diff2, diff3, diff4, diff5, diff6, diff7, diff8, diff9, diff10) ... end; > NULL; > > NULL; > tuple10(200, 12, 14, 0, 0, 0, 0, 0, 0, 0, 2); 1, "hourah!! we found a set", 5, " ", 17, " ", 19, 5, 5, 5, 5, 5, 5, 5, 7 2, "hourah!! we found a set", 17, " ", 29, " ", 31, 17, 17, 17, 17, 17, 17, 17, 19 3, "hourah!! we found a set", 29, " ", 41, " ", 43, 29, 29, 29, 29, 29, 29, 29, 31 4, "hourah!! we found a set", 59, " ", 71, " ", 73, 59, 59, 59, 59, 59, 59, 59, 61 5, "hourah!! we found a set", 137, " ", 149, " ", 151, 137, 137, 137, 137, 137, 137, 137, 139 6, "hourah!! we found a set", 179, " ", 191, " ", 193, 179, 179, 179, 179, 179, 179, 179, 181 > NULL; > > > NULL; > NULL; > > NULL; > NULL; > tuple10(900, 50, 2, 0, 0, 0, 0, 0, 0, 0, 0); 1, "hourah!! we found a set", 3, " ", 53, " ", 5, 3, 3, 3, 3, 3, 3, 3, 3 2, "hourah!! we found a set", 11, " ", 61, " ", 13, 11, 11, 11, 11, 11, 11, 11, 11 3, "hourah!! we found a set", 17, " ", 67, " ", 19, 17, 17, 17, 17, 17, 17, 17, 17 4, "hourah!! we found a set", 29, " ", 79, " ", 31, 29, 29, 29, 29, 29, 29, 29, 29 5, "hourah!! we found a set", 59, " ", 109, " ", 61, 59, 59, 59, 59, 59, 59, 59, 59 6, "hourah!! we found a set", 101, " ", 151, " ", 103, 101, 101, 101, 101, 101, 101, 101, 101 7, "hourah!! we found a set", 107, " ", 157, " ", 109, 107, 107, 107, 107, 107, 107, 107, 107 8, "hourah!! we found a set", 149, " ", 199, " ", 151, 149, 149, 149, 149, 149, 149, 149, 149 9, "hourah!! we found a set", 179, " ", 229, " ", 181, 179, 179, 179, 179, 179, 179, 179, 179 10, "hourah!! we found a set", 191, " ", 241, " ", 193, 191, 191, 191, 191, 191, 191, 191, 191 11, "hourah!! we found a set", 227, " ", 277, " ", 229, 227, 227, 227, 227, 227, 227, 227, 227 12, "hourah!! we found a set", 281, " ", 331, " ", 283, 281, 281, 281, 281, 281, 281, 281, 281 13, "hourah!! we found a set", 347, " ", 397, " ", 349, 347, 347, 347, 347, 347, 347, 347, 347 14, "hourah!! we found a set", 521, " ", 571, " ", 523, 521, 521, 521, 521, 521, 521, 521, 521 15, "hourah!! we found a set", 569, " ", 619, " ", 571, 569, 569, 569, 569, 569, 569, 569, 569 16, "hourah!! we found a set", 641, " ", 691, " ", 643, 641, 641, 641, 641, 641, 641, 641, 641 17, "hourah!! we found a set", 659, " ", 709, " ", 661, 659, 659, 659, 659, 659, 659, 659, 659 18, "hourah!! we found a set", 809, " ", 859, " ", 811, 809, 809, 809, 809, 809, 809, 809, 809 19, "hourah!! we found a set", 827, " ", 877, " ", 829, 827, 827, 827, 827, 827, 827, 827, 827 20, "hourah!! we found a set", 857, " ", 907, " ", 859, 857, 857, 857, 857, 857, 857, 857, 857 > NULL; Wife is calling. Got to go. |
2022-02-26, 07:24 | #7 |
"Matthew Anderson"
Dec 2010
Oregon, USA
3·17·23 Posts |
I did not know how to do the suggestion of kar_bon, so I just simplified the code. I tried to imitate an oeis.org .b file. Also, the user does not need to see the whole k-tuple, he can deduce that from the procedure call. He just needs the count, and the leading term. Here is the latest iteration. The 'NULL' displayed in the code are just redacted comments.
tup 10 h.mw (Maple Worksheet) > Code:
> NULL; > > NULL; > > tuple10 := proc (searchstop, diff1, diff2, diff3, diff4, diff5, diff6, diff7, diff8, diff9, diff10) local a, counter; counter := 1; for a from 3 by 2 to searchstop do if isprime(a) and isprime(a+diff1) and isprime(a+diff2) and isprime(a+diff3) and isprime(a+diff4) and isprime(a+diff5) and isprime(a+diff6) and isprime(a+diff7) and isprime(a+diff8) and isprime(a+diff9) and isprime(a+diff10) then lprint(counter, a); counter := counter+1 end if end do end proc; # Maple echo, truncated, showing passed parameters only. proc(searchstop, diff1, diff2, diff3, diff4, diff5, diff6, diff7, diff8, diff9, diff10) ... end; > NULL; > > tuple10(200, 12, 14, 0, 0, 0, 0, 0, 0, 0, 2); 1, 5 2, 17 3, 29 4, 59 5, 137 6, 179 > NULL; > > NULL; > tuple10(900, 50, 2, 0, 0, 0, 0, 0, 0, 0, 0); 1, 3 2, 11 3, 17 4, 29 5, 59 6, 101 7, 107 8, 149 9, 179 10, 191 11, 227 12, 281 13, 347 14, 521 15, 569 16, 641 17, 659 18, 809 19, 827 20, 857 > NULL; > NULL; > tuple10(500, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0); 1, 3 2, 17 3, 23 4, 29 5, 53 6, 59 7, 83 8, 107 9, 113 10, 137 11, 149 12, 167 13, 179 14, 197 15, 227 16, 233 17, 239 18, 263 19, 269 20, 293 21, 353 22, 389 23, 419 24, 443 25, 479 > NULL; Matt Last fiddled with by MattcAnderson on 2022-02-26 at 07:26 Reason: noticed procedure code not fully shown. Add carriage returns. |
2022-02-27, 14:48 | #8 |
"Matthew Anderson"
Dec 2010
Oregon, USA
3·17·23 Posts |
Hi there,
We are up to iteration 'i' of code to find prime numbers in an 11-tuple pattern or less. Here is the code with two test runs. I took out the "hourah" part, because either this is exciting to you, or it isn't. Also, it was a suggestion of another user. maple code Code:
tuple10 := proc (searchstop, diff1, diff2, diff3, diff4, diff5, diff6, diff7, diff8, diff9, diff10) local a, counter; counter := 1; print("Search for certain prime numbers"); print("Stop search at ", searchstop); print("Only display count and first prime in pattern."); for a from 3 by 2 to searchstop do if isprime(a) and isprime(a+diff1) and isprime(a+diff2) and isprime(a+diff3) and isprime(a+diff4) and isprime(a+diff5) and isprime(a+diff6) and isprime(a+diff7) and isprime(a+diff8) and isprime(a+diff9) and isprime(a+diff10) then lprint(counter, a); counter := counter+1 end if end do end proc Code:
> tuple10(200, 12, 14, 0, 0, 0, 0, 0, 0, 0, 2); "Search for certain prime numbers" "Stop search at ", 200 "Only display count and first prime in pattern." 1, 5 2, 17 3, 29 4, 59 5, 137 6, 179 > tuple10(900, 50, 2, 0, 0, 0, 0, 0, 0, 0, 0); "Search for certain prime numbers" "Stop search at ", 900 "Only display count and first prime in pattern." 1, 3 2, 11 3, 17 4, 29 5, 59 6, 101 7, 107 8, 149 9, 179 10, 191 11, 227 12, 281 13, 347 14, 521 15, 569 16, 641 17, 659 18, 809 19, 827 20, 857 > NULL; > NULL; > tuple10(500, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0); "Search for certain prime numbers" "Stop search at ", 500 "Only display count and first prime in pattern." 1, 3 2, 17 3, 23 4, 29 5, 53 6, 59 7, 83 8, 107 9, 113 10, 137 11, 149 12, 167 13, 179 14, 197 15, 227 16, 233 17, 239 18, 263 19, 269 20, 293 21, 353 22, 389 23, 419 24, 443 25, 479 Have a nice day. Last fiddled with by MattcAnderson on 2022-02-27 at 14:51 Reason: explain last output |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Matt's various websites | MattcAnderson | MattcAnderson | 6 | 2022-04-17 05:01 |
Matt's 3 tuple thread | MattcAnderson | MattcAnderson | 1 | 2022-02-21 15:37 |
some Method for prime constelation and k-tuple project | MattcAnderson | MattcAnderson | 0 | 2021-05-23 15:52 |
Proposed approach for k-tuple conjecture | maththinking | Miscellaneous Math | 2 | 2020-02-11 03:31 |
k-tuple assistance | MattcAnderson | Lounge | 1 | 2020-02-05 15:26 |