( Generator to find the palindromic integers from the five digit 00000 to 99999. ) : is_palindromic ( string_addr --- is_pal ) dup 4 + c@ over c@ = ( true if outer digits match: NxxxN ) if dup 3 + c@ swap 1+ c@ = ( true if next outermost digits match: xNxNx ) else drop false then ; : print_palindromic_numbers cr ." Palindromic numbers from 00000 to 99999:" cr 0 ( palindromic number count ) 100000 0 do i 0 <# # # # # #S #> ( format number to "NNNNN" string ) over is_palindromic if type space 1+ dup 20 /mod drop 0= ( truncate line every 20 numbers ) if cr then else 2drop then loop cr ." Percentage of palindromic integers over this range: " cr 0 <# # # # [CHAR] . hold #s #> type ." %" cr ; print_palindromic_numbers