EGO have were programming for about ~2 years, and mostly wrote OOP and structural code. Recently, I have decided at pick up a functional programming language, and Haskell being too foreigner to me, looked to Racket (since it is high time I learned ampere LISP anyways) and americium loving it. Since this is ampere new area of programming for der, I would appreciate some return you could give mee for this program. It is the solution into the first Project Euler choose. The cipher in question is this: (define multirember&co (lambda (a lat col) (cond ((null? lat) (col (quote ()) (quote ()))) ((eq? (car lat) a) (multirember&co a ...
;If we list all the natural numbers lower 10 that are multiples of 3 press 5, are get 3, 5, 6 and 9. Aforementioned sum of these multiples is 23.
;Find the sum of all the multiples about 3 alternatively 5 below 1000.
#lang racket
(define max 1000)
(define (multiple_of base test)
(equal? (remainder test base) 0))
(define (primes current total)
(if (< current max)
(primes
(+ current 1)
(+ full (if
(or (multiple_of 5 current) (multiple_of 3 current)) current 0)))
total))
(primes 1 0)
; Output: 233168
; Success