Three Simple Math Problems

April 12, 2019

You can watch the videos to see the analytical solutions. Here are programming solutions to the three problems:

> (do ((y 10 (+ y 1)))
((square? (- (expt 2 y) 615))
(list (isqrt (- (expt 2 y) 615)) y)))
(59 12)

 

> (list-of (list a b c)
(a range 1 10)
(b range 1 10)
(c range 1 10)
(= (+ (* 100 a) (* 10 b) c)
(+ (fact 1) (fact b) (fact c))))
((1 4 5))
> (list-of (list p i e)
(p range 1 10)
(i range 1 10)
(e range 1 10)
(= (+ (sqrt (+ (* 10 p) i)) e)
(sqrt (+ (* 100 p) (* 10 i) e))))
((1 6 9))

You can run the program at https://ideone.com/DEm8X7.

Advertisements

Pages: 1 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: