Sha256: 1ae9e3444e63026c6f58ab60e7fa7eb753455441b0fa7a69fa41ac8d44198212

Contents?: true

Size: 217 Bytes

Versions: 396

Compression:

Stored size: 217 Bytes

Contents

#lang racket

(provide perfect-numbers)

(define (perfect-numbers n)
  (filter perfect? (range 1 (add1 n))))

(define (perfect? n)
  (= (apply + (filter (lambda (x)
            (zero? (modulo n x))) (range 1 n))) n))

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.179 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.178 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.177 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.176 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.175 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.174 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.173 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.172 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.171 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.170 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.169 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.167 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.166 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.165 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.164 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.163 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.162 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.161 tracks/racket/exercises/perfect-numbers/example.rkt
trackler-2.2.1.160 tracks/racket/exercises/perfect-numbers/example.rkt