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

Home > Shapes
Total Triplet Treat (Posted on 2015-02-09) Difficulty: 3 of 5
Denote the respective length, breadth, width and the space diagonal of a rectangular cuboid as L, B, W and D.

Determine the total number of triplets (L, B, W) such that each of L,B,W and D is a positive integer with L+B+W = 29.

*** Order does not matter. For example (1,5,7) and (7,5,1) would be considered as different triplets.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution Comment 1 of 1
L B  W  D
4 5 20 21
4 20 5 21
5 4 20 21
5 20 4 21
6 6 17 19
6 17 6 19
8 9 12 17
8 12 9 17
9 8 12 17
9 12 8 17
12 8 9 17
12 9 8 17
17 6 6 19
20 4 5 21
20 5 4 21

There are only three basic solutions, with diagonals 17, 19 and 21. But since permutations are to be counted separately (I would describe that as "order does matter"), there are 15 such triplets, as two of the basic solutions have all different dimensions and thus 6 permutations, and one solution has a duplicated dimension and so has only 3 permutations.

DefDbl A-Z
Dim crlf$

Function mform$(x, t$)
  a$ = Format$(x, t$)
  If Len(a$) < Len(t$) Then a$ = Space$(Len(t$) - Len(a$)) & a$
  mform$ = a$
End Function

Private Sub Form_Load()
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
 DoEvents
 
 tot = 29
 For l = 1 To 27
 For b = 1 To 29 - l - 1
 w = 29 - l - b
   dsq = l * l + b * b + w * w
   sr = Int(Sqr(dsq) + 0.5)
   If sr * sr = dsq Then
     Text1.Text = Text1.Text & l & Str(b) & Str(w) & Str(sr) & crlf
   End If
 Next
 Next
 
 Text1.Text = Text1.Text & " done"
 
End Sub


  Posted by Charlie on 2015-02-09 14:40:57
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 (0)
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