154 where the base representations are:
414 232 181
DECLARE FUNCTION basen$ (x!, n!)
DECLARE FUNCTION isPalin! (s$)
FOR n = 10 TO 999999
IF isPalin(basen$(n, 6)) AND isPalin(basen$(n, 8)) AND isPalin(basen$(n, 9)) THEN
PRINT n, basen$(n, 6); " "; basen$(n, 8); " "; basen$(n, 9)
END IF
NEXT
FUNCTION basen$ (x, n)
s$ = ""
x2 = x
WHILE x2 > 0
d = x2 MOD n: x2 = x2 \ n
s$ = LTRIM$(MID$("0123456789abcdef", d + 1, 1)) + s$
WEND
basen$ = s$
END FUNCTION
FUNCTION isPalin (s$)
good = 1
FOR i = 1 TO LEN(s$) / 2
IF MID$(s$, i, 1) <> MID$(s$, LEN(s$) + 1 - i, 1) THEN good = 0: EXIT FOR
NEXT
isPalin = good
END FUNCTION
|
Posted by Charlie
on 2014-04-06 20:50:04 |