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

Home > Just Math
Hexagonal Palindrome (Posted on 2013-11-26) Difficulty: 2 of 5
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.)
Solution 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            5995
797           1269621

  Posted by Charlie on 2013-11-26 19:42:25
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 (16)
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