Paste: Euler 1

Author: jdrake
Mode: factor
Date: Tue, 23 Dec 2008 07:52:10
Plain Text |
! Copyright (C) 2008 Jeffrey Drake.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel math.ranges math sequences prettyprint ;
IN: euler1

: multipleOf3 ( n -- bool ) 3 mod 0 = ;
: multipleOf5 ( n -- bool ) 5 mod 0 = ;

: euler1 ( -- sequence ) 999 [1,b] [ dup multipleOf3 swap multipleOf5 or ] filter sum . ;

New Annotation

Summary:
Author:
Mode:
Body: