CARVIEW |
Select Language
HTTP/2 200
date: Mon, 13 Oct 2025 11:16:56 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=22fc025f30f50796689b53b8670af461205951298e06e604ffe190ff51c6ccc7a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22YlavamPC31bt_qQoNnocv92UJVIo-k2N%22%3B%7D; HttpOnly; Path=/
cf-ray: 98de6d79eb87d3d4-BLR
Racket #2 - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang racket
- ;(remainder 10 3) -> 1
- (define (gcd a b)
- (cond
- [(= a b) a]
- [(> a b) (gcd (- a b) b)]
- [else (gcd a (- b a))]))
- (define (mymaxdivisor x)
- (define (iteratedivisors d)
- (if (= (remainder x d) 0)
- d
- (iteratedivisors (- d 1))))
- (if (= x 1)
- x
- (iteratedivisors (- x 1))))
- ;(mymaxdivisor 53)
- (define (sum-odds a b)
- (define (iterator i sum)
- (if (and (>= i a) (<= i b))
- (if (not (= (remainder i 2) 0))
- (iterator (+ i 1) (+ sum i))
- (iterator (+ i 1) sum))
- sum))
- (iterator a 0))
- ;(sum-odds 0 10)
- (define (prime? n)
- (define upper (floor (sqrt n)))
- (define (iterator i)
- (if (> i upper)
- #t
- (if (= (remainder n i) 0)
- #f
- (iterator (+ i 1)))))
- (iterator 2))
- ;(prime? 19)
- (define (reverse n)
- (define (numlen num len)
- (if (= num 0)
- len
- (numlen (quotient num 10) (+ len 1))))
- (define len (numlen n 0))
- (define (iterator i num rev)
- (if (>= i 0)
- (iterator (- i 1) (quotient num 10) (+ rev (* (remainder num 10) (expt 10 i))))
- (/ rev 10)))
- (iterator len n 0))
- ;better reverse function
- ;(define (numlen num len)
- ; (if (= num 0)
- ; len
- ; (numlen (quotient num 10) (+ len 1))))
- ;(define (revs n)
- ; (if (< n 10)
- ; n
- ; (+ (* (remainder n 10) (expt 10 (- (numlen n 0) 1)))
- ; (revs (quotient n 10)))))
- (define (count-palindromes a b)
- (define (palindrome? n)
- (if (= n (reverse n))
- #t
- #f))
- (define (iterator i count)
- (if (and (>= i a) (<= i b))
- (if (palindrome? i)
- (iterator (+ i 1) (+ count 1))
- (iterator (+ i 1) count))
- count))
- (iterator a 0))
- (define (count-divisors n)
- (define (iterator i count)
- (if (< i 1)
- count
- (if (= (remainder n i) 0)
- (iterator (- i 1) (+ count 1))
- (iterator (- i 1) count))))
- (iterator n 0))
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐MAKE $9OO INSTANTLY D A⭐⭐
Java | 1 sec ago | 0.15 KB
-
📌 Instant BTC Profit Method ✅ Working E
JavaScript | 5 sec ago | 0.25 KB
-
🚨 Free Crypto Method 🚨
JavaScript | 6 sec ago | 0.24 KB
-
✅ Make $2500 in 20 minutes⭐ X
JavaScript | 12 sec ago | 0.25 KB
-
💡 EASY MONEY GUIDE ✅ Working
JavaScript | 16 sec ago | 0.24 KB
-
📌 Swapzone +37% glitch ⭐ 5
JavaScript | 20 sec ago | 0.25 KB
-
🔥 Exchange profit method
JavaScript | 26 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ⭐⭐ T
JavaScript | 28 sec ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand