All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Primes Around a Square (Posted on 2009-07-10) Difficulty: 2 of 5
A B C
D   E
F G H

The letters A-H are different digits from 1 to 9.

Read from left to right and top down, the four numbers formed are primes.

There is not just one solution. (Flipping along the diagonal A-H does not present a different solution).

Suppose "0" is allowed, and A cannot have that value, what other unique solutions are available?

See The Solution Submitted by brianjn    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution part 1 computer solution | Comment 5 of 12 |
 Where C > F:
 
 abc  adf  ceh  fgh
 
 239  241  967  157
 239  251  947  167
 239  257  941  761
 239  281  947  157
 239  281  947  167
 239  281  967  157
 257  241  769  139
 257  263  719  349
 257  263  719  389
 257  283  719  349
 257  281  739  149
 257  281  743  163
 257  281  743  193
 257  281  769  139
 257  281  769  149
 257  283  769  349
 263  241  359  179
 263  241  389  179
 263  241  397  157
 263  251  349  179
 263  251  347  197
 263  251  379  149
 263  251  389  149
 263  251  389  179
 263  271  359  149
 263  271  389  149
 263  281  347  157
 263  281  349  179
 263  281  347  197
 263  281  359  149
 263  281  359  179
 263  281  379  149
 263  281  397  157
 269  241  937  157
 269  241  953  173
 269  241  983  173
 269  251  947  137
 269  251  983  173
 269  257  983  743
 269  281  937  157
 269  281  947  137
 269  281  947  157
 269  283  947  317
 269  281  953  173
 283  241  359  179
 283  241  367  157
 283  241  367  197
 283  241  397  157
 283  241  397  167
 283  251  347  167
 283  251  349  179
 283  251  347  197
 283  251  367  197
 283  251  379  149
 283  251  397  167
 283  271  359  149
 293  241  367  157
 293  251  347  167
 293  281  347  157
 293  281  347  167
 293  281  367  157
 389  367  941  751
 439  421  967  157
 457  421  769  139
 457  463  719  389
 463  421  359  179
 463  421  389  179
 463  421  397  157
 479  421  953  163
 479  421  983  163
 487  421  769  139
 487  463  719  359
 523  541  367  197
 523  541  389  179
 523  541  397  167
 523  571  389  149
 547  523  719  389
 547  521  769  139
 547  523  769  389
 547  563  719  389
 563  521  349  179
 563  521  347  197
 563  521  379  149
 563  521  389  149
 563  521  389  179
 563  541  389  179
 563  541  397  127
 563  571  389  149
 569  521  947  137
 569  523  947  317
 569  521  983  173
 569  541  937  127
 569  541  983  173
 587  523  719  349
 587  521  739  149
 587  521  743  163
 587  521  743  193
 587  521  769  139
 587  521  769  149
 587  523  769  349
 587  541  769  139
 587  563  719  349
 593  521  347  167
 593  541  367  127
 647  653  719  389
 647  683  719  359
 653  641  389  179
 653  641  397  127
 653  691  347  127
 659  617  983  743
 659  631  947  127
 659  641  937  127
 659  641  983  173
 659  683  947  317
 683  641  359  179
 683  641  397  127
 683  641  397  157
 683  691  347  127
 683  691  347  157
 827  853  719  349
 827  853  769  349
 827  863  719  349
 827  863  719  359
 829  853  947  317
 829  853  947  367
 829  857  941  761
 829  853  967  317
 829  853  967  347
 829  863  947  317
 839  821  947  157
 839  821  947  167
 839  827  941  751
 839  827  941  761
 839  821  967  157
 839  857  941  761
 853  821  347  167
 853  821  349  179
 853  821  347  197
 853  821  367  197
 853  821  379  149
 853  821  397  167
 857  823  719  349
 857  821  739  149
 857  821  743  163
 857  821  743  193
 857  821  769  139
 857  821  769  149
 857  823  769  349
 857  863  719  349
 859  821  937  167
 859  821  947  137
 859  821  947  167
 859  823  947  317
 859  823  947  367
 859  827  941  761
 859  821  967  137
 859  823  967  317
 859  823  967  347
 859  863  947  317
 863  821  347  157
 863  821  349  179
 863  821  347  197
 863  821  359  149
 863  821  359  179
 863  821  379  149
 863  821  397  157
 953  941  367  127
 983  941  367  127
 983  941  367  157
 169 (the count)


 
 If any had 6 primes (using the middle rows) those would have been flagged via an asterisk, but none were.

 
    10   N="123456789"
    20   H=N
    30   repeat
    40       Abc=val(left(N,3))
    50       Adf=val(left(N,1)+mid(N,4,1)+mid(N,6,1))
    60       Ceh=val(mid(N,3,1)+mid(N,5,1)+mid(N,8,1))
    70       Fgh=val(mid(N,6,3))
    72       Xtra1=val(mid(N,2,1)+mid(N,9,1)+mid(N,7,1))
    73       Xtra2=val(mid(N,4,1)+mid(N,9,1)+mid(N,5,1))
    79       if mid(N,3,1)>mid(N,6,1) then
    80       :if prmdiv(Abc)=Abc and prmdiv(Adf)=Adf and prmdiv(Ceh)=Ceh and prmd
 iv(Fgh)=Fgh then print Abc;Adf;Ceh;Fgh;:Ct=Ct+1:if prmdiv(Xtra1)=Xtra1 and prmdi
 v(Xtra2)=Xtra2 then print " *":else print:endif:if Ct@40=0 then while inkey="":w
 end:print
    90       gosub *Permute(&N)
   100   until N=H
   800   print Ct
   810   end

Edited on July 11, 2009, 1:01 pm
  Posted by Charlie on 2009-07-11 13:00:46

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (14)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information