! Copyright (c) 2008 Eric Mertens ! See http://factorcode.org/license.txt for BSD license. USING: kernel math sequences sequences.private locals hints ; IN: project-euler.150 :: (euler150) ( m -- n ) [let | table [ sums-triangle ] | m [| x | x 1+ [| y | m x - [| z | x z + table nth-unsafe [ y z + 1+ swap nth-unsafe ] [ y swap nth-unsafe ] bi - ] map partial-sum-infimum ] map-infimum ] map-infimum ] ; HINTS: (euler150) fixnum ; : euler150 ( -- n ) 1000 (euler150) ;