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

Home > Numbers
Going Cyclic With Geometric II (Posted on 2009-07-04) Difficulty: 3 of 5
Three 3-digit non leading zero positive base N integers P, Q and R, with P > Q > R, are such that:

  • Q is the geometric mean of P and R, and:
  • P, Q and R can be derived from one another by cyclic permutation of digits.

Determine all possible positive integer values of N < 30 for which this is possible.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: computer solution for N<=100 -- the program Comment 4 of 4 |
(In reply to computer solution for N<=100 by Charlie)

DEFDBL A-Z
CLS
FOR n = 2 TO 100
  n2 = n * n
  FOR a = 1 TO n - 1
  FOR b = 1 TO n - 1
  FOR c = 1 TO n - 1
    p = a * n2 + b * n + c
    q = b * n2 + c * n + a
    r = c * n2 + a * n + b
    IF p > q AND q > r THEN
     a2 = b: b2 = c: c2 = a
     a3 = c: b3 = a: c3 = b
     GOSUB report
    END IF
    SWAP q, r
    IF p > q AND q > r THEN
     a2 = c: b2 = a: c2 = b
     a3 = b: b3 = c: b3 = a
     GOSUB report
    END IF
  NEXT
  NEXT
  NEXT
NEXT n
END

report:
     IF q * q = p * r THEN
       PRINT USING "###  ##  ##  ##    ##  ##  ##    ##  ##  ##    ######## ######## ########"; n; a; b; c; a2; b2; c2; a3; b3; c3; p; q; r
       ct = ct + 1
       IF ct MOD 40 = 0 THEN DO: LOOP UNTIL INKEY$ > "": PRINT
     END IF
RETURN

 


  Posted by Charlie on 2009-07-04 16:05:28
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 (6)
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