Determine the maximum value of a (base ten) positive integer N (with non leading zeroes) such that each of the digits of N, with the exception of the first digit and the last digit, is less than the harmonic mean of the two neighboring digits.
*** For an extra challenge, solve this puzzle without the aid of a computer program.
It seems the number should be a palindrome with either an even or odd number of digits. The center digit or digits will be the smallest with the largest (probably 9's) at the beginning and end.
Assuming odd number of digits:
center 1:
212, end
313, end
etc... [it turns out a 1 doesn't get you far because the h.m. of 1 and a number is always less than 2]
center 2:
323, 73237 or 83238 or 93239
424, end
center 3:
434, 74347 or 84348 or 94349
535, end
center 4:
545, 75457 or 85458 or 95459
646, end
center 5:
656, 86568 or 96569
757, end
center 6:
767, 97679
868, end
center 7: 878 or 979
center 8: 989
It turns out we cannot exceed 5 digits assuming an odd number.
For an even number of digits you can just add an extra copy of the center digit since x is less than the HM of x and x+1.
So extend 97679 to
976679 for the solution.

Posted by Jer
on 20131228 23:54:34 