Re: Fun with guile, Erastones + goldbach conjecture

2013-04-09 Thread Ian Price
Panicz Maciej Godek writes: > Section 3.5 (Streams), which introduces the notion > of streams, or lazy lists (that can be infinite), with the > most amazing example of Erastostenes' sieve,A (B > implementation, as well as sections,A (B4.1,A (Band,A (B4.3,A (Bof My pedant sense is tingl

Re: Fun with guile, Erastones + goldbach conjecture

2013-04-09 Thread Ian Price
Stefan Israelsson Tampe writes: > Hi all, > > The program below is an interesting variant of a sieve that given an > even number seams to constructs two primes that added together becomes > the even > number, the file below does this construction for n = 3 ... 1000. Amusing, but I feel that co

Re: Fun with guile, Erastones + goldbach conjecture

2013-04-09 Thread Panicz Maciej Godek
Hey, I see that the style of your code is fairly unorthodox. I'd suggest you to read the following chapters of SICP, if you haven't already: Section 3.5 (Streams), which introduces the notion of streams, or lazy lists (that can be infinite), with the most amazing example of Erastostenes' sieve impl

Re: Fun with guile, Erastones + goldbach conjecture

2013-04-09 Thread Stefan Israelsson Tampe
Actually, inserting a primality check 500 out of 1000 items is nonprime. but this algorithm still shows some interesting aspect and adding to the algorithm to sellect the inner pair that sum to n, we do get primality for all n = 3 ... 1000. Kind of cool. ---

Fun with guile, Erastones + goldbach conjecture

2013-04-08 Thread Stefan Israelsson Tampe
Hi all, The program below is an interesting variant of a sieve that given an even number seams to constructs two primes that added together becomes the even number, the file below does this construction for n = 3 ... 1000. Have fun! /Stefan (use-modules (srfi srfi-1)) (define (analyze k)