Haskell, 95C134C
Golfed:
c n=null[x|x<-[2..n-1],n`mod`x==0]&&n>1
p=filter c[1..]
g l(m:n:o)=do;print
|(n-m)>l=do print(m,n,n-m);g(n-m)(n:o)
|True=g l(n:o)
main=g 0 p
Ungolfed:
-- determinesc function checks if n is prime
isPrime na =prime nullnumber
c [x|x<n=null[x|x<-[2..n-1],n`mod`x==0] && n > 1n`mod`x==0]&&n>1
-- constructsp is an infinite list of primes
primes = filter isPrimep=filter [1c[1..]
-- printsg outfunction theprints differencea betweenlist firstof twoprimes elements,and differences.
-- recurses onto listl createdis bythe skippingmaximum firstdifference elementseen so far
gaps-- (m:n:pso) =is do
the list of unprocessed printprimes
g l(n-m:n:o)
|(n-m)>l=do print(m,n,n-m);g(n-m)(n:o)
gaps|True=g l(n:pso)
-- runmain starts the gapsball functionrolling with thea infinitedefault listmax-seen value of primes0
main =main=g gaps0 primesp