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

Home > Numbers
Age Progression (Posted on 2017-01-16) Difficulty: 2 of 5
Today the integer ages of brothers Alex, Bert, and Carl form an arithmetic progression.

Two months later, after Alex's birthday, the ages form a geometric progression.

Is Alex the oldest, youngest, or middle child?

No Solution Yet Submitted by Brian Smith    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
the cases -- to age 100 Comment 3 of 3 |
oldest 1 2 3
youngest 3 6 9
oldest 4 6 8
youngest 8 12 16
oldest 9 12 15
youngest 15 20 25
oldest 16 20 24
youngest 24 30 36
oldest 25 30 35
youngest 35 42 49
oldest 36 42 48
youngest 48 56 64
oldest 49 56 63
youngest 63 72 81
oldest 64 72 80
youngest 80 90 100
oldest 81 90 99

DefDbl A-Z
Dim crlf$


Private Sub Form_Load()
 Form1.Visible = True
 
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 For x = 1 To 100
 For y = x + 1 To 100
  DoEvents
   d = y - x
   z = y + d
   xp = x + 1: yp = y + 1: zp = z + 1
   sq = xp * z
   If y * y = sq Then Text1.Text = Text1.Text & "youngest " & x & Str(y) & Str(z) & crlf
   sq = x * z
   If yp * yp = sq Then Text1.Text = Text1.Text & "middle " & x & Str(y) & Str(z) & crlf
   sq = x * zp
   If y * y = sq Then Text1.Text = Text1.Text & "oldest " & x & Str(y) & Str(z) & crlf
 Next y
 Next x
 
 Text1.Text = Text1.Text & crlf & " done"
  
End Sub


  Posted by Charlie on 2017-01-16 16:01:35
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 (4)
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