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

Home > Numbers
Prime only as it is (Posted on 2013-01-22) Difficulty: 1 of 5
Find a 3-digit prime number consisting of 3 distinct prime digits, such that none of its other 3-digit permutations and none of its 2-digit combinations are prime?

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 2

   10        P=nxtprm(100)
   20        while P<999
   30          Ps=cutspc(str(P))
   40          D1=mid(Ps,1,1):D1n=val(D1)
   50          D2=mid(Ps,2,1):D2n=val(D2)
   60          D3=mid(Ps,3,1):D3n=val(D3)
   65          X0=P @ 100
   70          A=val(D1+D3+D2):Ax=A @ 100
   80          B=val(D2+D3+D1):Bx=B @ 100
   90          C=val(D2+D1+D3):Cx=C @ 100
  100          D=val(D3+D1+D2):Dx=D @ 100
  110          E=val(D3+D2+D1):Ex=E @ 100
  120          if prmdiv(A)<A and prmdiv(B)<B and prmdiv(C)<C and prmdiv(D)<D and prmdiv(E)<E then
  121           :if prmdiv(Ax)<Ax and prmdiv(Bx)<Bx and prmdiv(Cx)<Cx and prmdiv(Dx)<Dx and prmdiv(Ex)<Ex and prmdiv(X0)<X0 then
  125           :if prmdiv(D1n)=D1n and prmdiv(D2n)=D2n and prmdiv(D3n)=D3n then print P
  130          P=nxtprm(P)
  140        wend

finds

257


  Posted by Charlie on 2013-01-22 13:31:19
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 (7)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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