Three 3-digit non leading zero positive base N integers P
, with P
, are such that:
is the harmonic mean of P
can be derived from one another by
Determine all possible positive integer values of N ≤ 30 for which this is possible.
I can't come up with anything using the following code:
FOR n = 2 TO 30
FOR a = 1 TO n-1
FOR b = 0 TO n-1
FOR c = 0 TO n-1
abc = Base2Dec(a, b, c, n)
bca = Base2Dec(b, c, a, n)
cab = Base2Dec(c, a, b, n)
IF abc <> bca AND abc <> cab THEN
IF bca = HMean(abc, cab) THEN PRINT abc, bca, cab, n
IF cab = HMean(abc, bca) THEN PRINT abc, cab, bca, n
IF abc = HMean(bca, cab) THEN PRINT bca, abc, cab, n
FUNCTION Base2Dec (a, b, c, base)
Base2Dec = a*base^2 + b*base + c
FUNCTION HMean (x, y)
HMean = 2*x*y / (x + y)
The closest I can find is '102', '120', and '210' in base 4 (18, 24, and 36 respectively), which I'm pretty sure is not a cyclic permutation.
I also ran the above code for n = 31 to 50 and still came up with nothing.