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

 Hexagonal Palindrome (Posted on 2013-11-26)
Determine the minimum value of a hexagonal number H(p) = 2p2 - p, such that each of p and H(p) is a base ten palindrome.

*** p must have more than one digit, so trivial solutions like p=0,1 are not valid.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution Comment 2 of 2 |

DEFDBL A-Z
FOR p = 11 TO 999999
p\$ = LTRIM\$(STR\$(p))
good = 1
FOR i = 1 TO LEN(p\$) / 2
IF MID\$(p\$, i, 1) <> MID\$(p\$, LEN(p\$) + 1 - i, 1) THEN good = 0: EXIT FOR
NEXT
IF good THEN
h = 2 * p * p - p
h\$ = LTRIM\$(STR\$(h))
FOR i = 1 TO LEN(h\$) / 2
IF MID\$(h\$, i, 1) <> MID\$(h\$, LEN(h\$) + 1 - i, 1) THEN good = 0: EXIT FOR
NEXT
IF good THEN PRINT p, h
END IF
NEXT p

finds only

` p            H(p)55            5995797           1269621`

 Posted by Charlie on 2013-11-26 19:42:25

 Search: Search body:
Forums (0)