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