Egison - Prime Numbers Demonstration [PDF]

Extract all twin primes from the infinite list of prime numbers with pattern-matching! 8. (define $twin-primes. 9. (matc

4 downloads 25 Views 22KB Size

Recommend Stories


Prime Numbers in Music Tonality
Forget safety. Live where you fear to live. Destroy your reputation. Be notorious. Rumi

The first 50 million prime numbers
You're not going to master the rest of your life in one day. Just relax. Master the day. Than just keep

Prime and Composite Numbers, GCF, and LCM
I tried to make sense of the Four Books, until love arrived, and it all became a single syllable. Yunus

Prime Numbers and the Riemann Hypothesis
Come let us be friends for once. Let us make life easy on us. Let us be loved ones and lovers. The earth

PDF Wonders of Numbers
In the end only three things matter: how much you loved, how gently you lived, and how gracefully you

Names & Numbers (PDF)
Ask yourself: How do I feel about the pace of my life? Is it too fast, too slow, or just about right?

Demonstration
Respond to every call that excites your spirit. Rumi

a PDF of this demonstration
No amount of guilt can solve the past, and no amount of anxiety can change the future. Anonymous

Unexpected irregularities in the distribution of prime numbers
Ego says, "Once everything falls into place, I'll feel peace." Spirit says "Find your peace, and then

CHAPTER I: PRIME NUMBERS Section 3: Types of Primes
Those who bring sunshine to the lives of others cannot keep it from themselves. J. M. Barrie

Idea Transcript


Sequece of Prime Numbers You can edit and run the following code. Enjoy Egison programming! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

;;; ;;; ;;; Pattern-matching against sequence of natural numbers ;;; ;;; ;; Extract all twin primes from the infinite list of prime numbers with pattern-matching! (define $twin-primes (match-all primes (list integer) [ [p (+ p 2)]])) ;; Enumerate first 10 twin primes (take 10 twin-primes) ;; Extract all prime-triplets from the infinite list of prime numbers with pattern-matching! (define $prime-triplets (match-all primes (list integer) [ [p m (+ p 6)]])) ;; Enumerate first 10 twin primes (take 10 prime-triplets)

Run

What to do next... Next Demonstration (./tree.html) Back to Home (/)

comments powered by Disqus (http://disqus.com)

This website in other langauge: English (/), (/ja/)

© 2011-2017 Satoshi Egi (/~egi/) All Rights Reserved. Sponsored by Rakuten, Inc. (http://global.rakuten.com/corp/) and Rakuten Institute of Technology (http://rit.rakuten.co.jp/).

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.