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

Home > Numbers
Prime * Prime (Posted on 2009-08-15) Difficulty: 3 of 5
Three different digits are chosen from among 1 - 9. When arranged in each of the six possible orders, each of the resulting 3-digit numbers is the product of exactly two primes

What are the three digits?

  Submitted by Charlie    
Rating: 5.0000 (1 votes)
Solution: (Hide)
The six 3-digit numbers, and their prime factorizations are:

 178         2 * 89
 187         11 * 17
 718         2 * 359
 781         11 * 71
 817         19 * 43
 871         13 * 67


list
    5   dim Used(9)
   10   for D1=1 to 9
   20     Used(D1)=1
   30   for D2=1 to 9
   40    if Used(D2)=0 then
   50     :Used(D2)=1
   60   :for D3=1 to 9
   70    :if Used(D3)=0 then
   80     :Used(D3)=1
   90     :if fnOk(100*D1+10*D2+D3) then
  100     :if fnOk(100*D1+10*D3+D2) then
  110     :if fnOk(100*D2+10*D1+D3) then
  120     :if fnOk(100*D2+10*D3+D1) then
  130     :if fnOk(100*D3+10*D1+D2) then
  140     :if fnOk(100*D3+10*D2+D1) then
  150      :print D1;D2;D3,
  151          :Q=100*D1+10*D2+D3
  152          :print prmdiv(Q);prmdiv(Q//prmdiv(Q))
  160     :endif
  170     :endif
  180     :endif
  190     :endif
  200     :endif
  210     :endif
  220     :Used(D3)=0
  230    :endif
  240   :next
  250     :Used(D2)=0
  260    :endif
  270   next D2
  280     Used(D1)=0
  290   next D1
  300   end
  400   fnOk(X)
  410   if prmdiv(X)=X then return(0)
  420   N=X//prmdiv(X)
  430   if prmdiv(N)=N then return(-1)
  440   return(0)
OK
run
 1  7  8         2  89
 1  8  7         11  17
 7  1  8         2  359
 7  8  1         11  71
 8  1  7         19  43
 8  7  1         13  67
OK

Based on Enigma No. 1552, "Prime products", by Richard England, New Scientist, 4 July 2009, page 24.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
Solutionpencil and paper solutionDaniel2009-08-15 23:10:39
SolutionSolutionDej Mar2009-08-15 16:40:41
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (17)
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