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

Home > Numbers
Product Four Times Sum (Posted on 2007-11-23) Difficulty: 4 of 5
What are all the ordered triples of positive integers (x,y,z) with x<y<z, such that their product is four times their sum?

See The Solution Submitted by Charlie    
Rating: 3.0000 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Computer Assist | Comment 3 of 5 |
The following MS-DOS QBasic program finds the same results a Fernando.

I actually ran it with z finishing at 100.  I have reset it to 1000 in this listing but it takes forever; thinking about a C version. 

There is however a problem with these solutions, not the solution as such, nor the program.  What is missing is an argument as why these may/not be the only solutions.  I note that the results have the following primes as factors in one form or another: 1, 2, 3, 5 and 7.

My concern for a justifiable argument is that if I start with 1, 2 and P as my factors then 1*2*P < 4*(1+2+P) no matter how large P might be.
--------------------------------------------------------------------
The program:
(Needs some tidying but it works!)

   CLS

 ' x < y < z
 ' x is also greater that 0

   m = 1
   y = 2
   z = 3

 
 FOR a = 0 TO 4   'Provides for x to be incremented


 FOR x = a TO y - 1
 FOR y = x + 1 TO z - 1
 FOR z = y + 1 TO 1000
 

 LOCATE m, 1     'Overwrite invalid results to avoid
                 ' scrolling loss of valid results

 PRINT "a"; a; "x"; x; "y"; y; "z"; z;
      

Prod = x * y * z
sum = x + y + z

Foursum = 4 * sum


 IF Prod = Foursum THEN
  ' LOCATE m, 20
 
     PRINT "prod"; Prod; "sum"; Foursum; "x,y,z"; x; y; z
  
   m = m + 1      'Having located and printed a valid
                  'result locate for next values.
 END IF

NEXT
NEXT
NEXT
NEXT







  Posted by brianjn on 2007-11-23 21:11:10
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 (23)
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