Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Tau-number/Racket/tau-number.rkt
Normal file
19
Task/Tau-number/Racket/tau-number.rkt
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#lang racket
|
||||
|
||||
(define limit 100)
|
||||
|
||||
(define (divisor-count n)
|
||||
(length (filter (λ (x) (zero? (remainder n x))) (range 1 (+ 1 n)))))
|
||||
|
||||
(define (display-tau-numbers (n 1) (count 1))
|
||||
(when (<= count limit)
|
||||
(if (zero? (remainder n (divisor-count n)))
|
||||
(begin
|
||||
(printf (~a n #:width 5 #:align 'right))
|
||||
(when (zero? (remainder count 10))
|
||||
(newline))
|
||||
(display-tau-numbers (add1 n) (add1 count)))
|
||||
(display-tau-numbers (add1 n) count))))
|
||||
|
||||
(printf "The first ~a Τau numbers are~n" limit)
|
||||
(display-tau-numbers)
|
||||
Loading…
Add table
Add a link
Reference in a new issue