mersenneforum.org Primes from powers of 2 strings.
 Register FAQ Search Today's Posts Mark Forums Read

 2011-02-07, 17:56 #1 Flatlander I quite division it     "Chris" Feb 2005 England 31×67 Posts 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!
 2011-02-07, 18:50 #2 nuggetprime     Mar 2007 Austria 1001011102 Posts 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)) 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!
2011-02-07, 19:10   #3
petrw1
1976 Toyota Corona years forever!

"Wayne"
Nov 2006

22×3×433 Posts

Quote:
 Originally Posted by Flatlander 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!
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.

2011-02-07, 20:25   #4
axn

Jun 2003

2×2,687 Posts

Quote:
 Originally Posted by petrw1 It "appears" that every second string starting with 1,2 add up to a multiple of 3 and so CANNOT be prime.
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.

2011-02-07, 20:56   #5
Flatlander
I quite division it

"Chris"
Feb 2005
England

31×67 Posts

Quote:
 Originally Posted by petrw1 I assume the "strings" need to be kept intact? ...
Yes.

 2011-02-08, 11:26 #6 Merfighters     Mar 2010 On front of my laptop 7×17 Posts 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
 2011-02-08, 15:28 #7 Flatlander I quite division it     "Chris" Feb 2005 England 81D16 Posts Very nice. How did you find it?
2011-02-08, 16:17   #8
nuggetprime

Mar 2007
Austria

4568 Posts

Quote:
 Originally Posted by nuggetprime 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)) 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!
Tested upto ca.10000 digits-no primes.
Will try another orientation and hopefully I can beat the 220 digit record!

 2011-02-08, 19:49 #9 CRGreathouse     Aug 2006 3·1,993 Posts I have a 1224-digit prime using the powers of 2^0 to 2^88: Code: 309485009821345068724781056154742504910672534362390528773712524553362671811952643868562622766813359059763219342813113834066795298816967140655691703339764940848357032784585166988247042417851639229258349412352120892581961462917470617660446290980731458735308830223145490365729367654415111572745182864683827275557863725914323419136377789318629571617095681888946593147858085478494447329657392904273924722366482869645213696236118324143482260684811805916207174113034245902958103587056517122951479051793528258561475739525896764129287378697629483820646436893488147419103232184467440737095516169223372036854775808461168601842738790423058430092136939521152921504606846976576460752303423488288230376151711744144115188075855872720575940379279363602879701896396818014398509481984900719925474099245035996273704962251799813685248112589990684262456294995342131228147497671065614073748835532870368744177664351843720888321759218604441687960930222084398046511104219902325555210995116277765497558138882748779069441374389534726871947673634359738368171798691848589934592429496729621474836481073741824536870912268435456134217728671088643355443216777216838860841943042097152104857652428826214413107265536327681638481924096204810245122561281632864421
2011-02-08, 23:55   #10
R.D. Silverman

"Bob Silverman"
Nov 2003
North of Boston

11101001001002 Posts

Quote:
 Originally Posted by Flatlander 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.
Are duplicates allowed; e.g. 4421?

Using your rules, I expect only finitely many; the numbers grow too
fast.

2011-02-09, 00:01   #11
Flatlander
I quite division it

"Chris"
Feb 2005
England

31×67 Posts

Quote:
 Originally Posted by R.D. Silverman Are duplicates allowed; e.g. 4421? Using your rules, I expect only finitely many; the numbers grow too fast.
No duplicates for this puzzle. I assumed there would be too many primes if things weren't restricted.

 Similar Threads Thread Thread Starter Forum Replies Last Post davar55 Puzzles 13 2018-03-15 14:46 mickfrancis Factoring 2 2016-05-06 08:13 EdH Programming 15 2013-05-06 11:04 Andi47 Programming 5 2008-12-28 05:52 davar55 Puzzles 5 2008-11-02 00:08

All times are UTC. The time now is 05:55.

Mon Jun 27 05:55:58 UTC 2022 up 74 days, 3:57, 1 user, load averages: 1.19, 1.15, 1.08