USING: kernel locals make math math.order math.parser math.ranges sequences ; IN: problem4 : pali? ( x -- ? ) dup reverse = ; : num-pali? ( x -- ? ) number>string pali? ; :: make-range ( a b -- seq ) [ a b [a,b] [| x | a b [a,b] [| y | t [ x y * , ] when ] each ] each ] { } make ; : problem4 ( -- n ) 100 999 make-range [ num-pali? ] filter 0 [ max ] reduce ;