![]() |
Primes from powers of 2 strings.
Create primes by arranging the strings produced from progressive powers of 2 from 2^0 to 2^n. i.e.
A prime using the string "1", none. A prime using the strings "2" and"1", none. A prime using the strings "4", "2" and "1", 421 or 241. etc. No taking parts of strings. All strings from 1 to your chosen n must be used. What is the largest prime you can make? The largest prime for the strings in order or near order, near reverse etc? The largest prime that is also a twin (+2 or -2) or has other interesting properties? Kudos for posting small, efficient code. If this is known or on OEIS create a similar more interesting puzzle! :smile: |
How about this small little PARI-GP function:
[CODE]for(z=1,100,y=2^z;for(x=1,z-1,y*=10^(ceil(log(2)*(z-x)/log(10)));y+=2^(z-x));y*=10;y++;write("cand_puzzle.txt",y))[/CODE] writes candidates into cand_puzzle.txt like this z(1)=21 z(2)=421 z(3)=8421... upto z=100.(you can ofcourse go further if you want) Then pump the output into PFGW and hopefully I'll find something! |
[QUOTE=Flatlander;251680]Create primes by arranging the strings produced from progressive powers of 2 from 2^0 to 2^n. i.e.
A prime using the string "1", none. A prime using the strings "2" and"1", none. A prime using the strings "4", "2" and "1", 421 or 241. etc. No taking parts of strings. All strings from 1 to your chosen n must be used. What is the largest prime you can make? The largest prime for the strings in order or near order, near reverse etc? The largest prime that is also a twin (+2 or -2) or has other interesting properties? Kudos for posting small, efficient code. If this is known or on OEIS create a similar more interesting puzzle! :smile:[/QUOTE] I assume the "strings" need to be kept intact? i.e. in 1,2,4,8,16,32 --- the 16 and the 32 can't be split as in 41823621? It "appears" that every second string starting with 1,2 add up to a multiple of 3 and so CANNOT be prime. |
[QUOTE=petrw1;251692]It "appears" that every second string starting with 1,2 add up to a multiple of 3 and so CANNOT be prime.[/QUOTE]
Basic restrictions -- all powers of two end in an even digit except 1. So only permutations ending in 1 has a chance of being prime. Also, for even n, the sum of digits of 2^0 .. 2^n is divisible by 3. So only odd 'n' has a chance of yielding primes. |
[QUOTE=petrw1;251692]I assume the "strings" need to be kept intact?
...[/QUOTE] Yes. |
220 digits
[CODE]8589934592838860881928687194767366710886465536645368709125242885124294967296419430440964343597383683355443232768322684354562621442562147483648209715220482171798691841677721616384161342177281310721048576107374182410241281 8589934592_8388608_8192_8_68719476736_67108864_65536_64_536870912_524288_512_4294967296_4194304_4096_4_34359738368_33554432_32768_32_268435456_262144_256_2147483648_2097152_2048_2_17179869184_16777216_16384_16_134217728_131072_1048576_1073741824_1024_128_1[/CODE] :smile: |
Very nice. How did you find it? :smile:
|
[QUOTE=nuggetprime;251688]How about this small little PARI-GP function:
[CODE]for(z=1,100,y=2^z;for(x=1,z-1,y*=10^(ceil(log(2)*(z-x)/log(10)));y+=2^(z-x));y*=10;y++;write("cand_puzzle.txt",y))[/CODE]writes candidates into cand_puzzle.txt like this z(1)=21 z(2)=421 z(3)=8421... upto z=100.(you can ofcourse go further if you want) Then pump the output into PFGW and hopefully I'll find something![/QUOTE] Tested upto ca.10000 digits-no primes. Will try another orientation and hopefully I can beat the 220 digit record! |
I have a 1224-digit prime using the powers of 2^0 to 2^88:
[code]309485009821345068724781056154742504910672534362390528773712524553362671811952643868562622766813359059763219342813113834066795298816967140655691703339764940848357032784585166988247042417851639229258349412352120892581961462917470617660446290980731458735308830223145490365729367654415111572745182864683827275557863725914323419136377789318629571617095681888946593147858085478494447329657392904273924722366482869645213696236118324143482260684811805916207174113034245902958103587056517122951479051793528258561475739525896764129287378697629483820646436893488147419103232184467440737095516169223372036854775808461168601842738790423058430092136939521152921504606846976576460752303423488288230376151711744144115188075855872720575940379279363602879701896396818014398509481984900719925474099245035996273704962251799813685248112589990684262456294995342131228147497671065614073748835532870368744177664351843720888321759218604441687960930222084398046511104219902325555210995116277765497558138882748779069441374389534726871947673634359738368171798691848589934592429496729621474836481073741824536870912268435456134217728671088643355443216777216838860841943042097152104857652428826214413107265536327681638481924096204810245122561281632864421[/code] |
[QUOTE=Flatlander;251680]Create primes by arranging the strings produced from progressive powers of 2 from 2^0 to 2^n. i.e.
A prime using the string "1", none. A prime using the strings "2" and"1", none. A prime using the strings "4", "2" and "1", 421 or 241. etc. No taking parts of strings. All strings from 1 to your chosen n must be used. [/QUOTE] Are duplicates allowed; e.g. 4421? Using your rules, I expect only finitely many; the numbers grow too fast. |
[QUOTE=R.D. Silverman;251858]Are duplicates allowed; e.g. 4421?
Using your rules, I expect only finitely many; the numbers grow too fast.[/QUOTE] No duplicates for this puzzle. I assumed there would be too many primes if things weren't restricted. :smile: |
| All times are UTC. The time now is 19:13. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.