Haskell, 134C ---- Golfed: c n=null[x|x<-[2..n-1],n`mod`x==0]&&n>1 p=filter c[1..] g l(m:n:o) |(n-m)>l=do print(m,n,n-m);g(n-m)(n:o) |True=g l(n:o) main=g 0 p Ungolfed: -- c function checks if n is a prime number c n=null[x|x<-[2..n-1],n`mod`x==0]&&n>1 -- p is an infinite list of primes p=filter c[1..] -- g function prints a list of primes and differences. -- l is the maximum difference seen so far -- (m:n:o) is the list of unprocessed primes g l(m:n:o) |(n-m)>l=do print(m,n,n-m);g(n-m)(n:o) |True=g l(n:o) -- main starts the ball rolling with a default max-seen value of 0 main=g 0 p