c A071912 Compute mmm terms (set mmm in line 4)
	implicit integer(a-z)
	integer a(0:10000)
	mmm=100
	a(0)=0
	a(1)=1
	a(2)=1
	do 10 n=3,mmm
c look for a(n)
	n1=a(n-1)
	if(n1.eq.1)goto 11
c try going down
	do 12 i=n1,1,-1
	j=ngcd(n1,i)
	if(j.gt.1)goto 12
c is (n1,i) new?
	do 15 i2=0,n-2
	if(a(i2).eq.n1.and.a(i2+1).eq.i)goto 12
15	continue
c yes OK!
	a(n)=i
	goto 10
12	continue
c didn't find it
11	continue
c must go up
	do 14 i=n1+1,100000
	j=ngcd(n1,i)
	if(j.gt.1)goto 14
c is (n1,i) new?
	do 17 i2=0,n-2
	if(a(i2).eq.n1.and.a(i2+1).eq.i)goto 14
17	continue
c yes OK!
	a(n)=i
	goto 10
14	continue
c didn't find it
	write(*,*)"ERROR 1"
10 	continue
c print
	write(*,100)(a(i),i=0,mmm)
100	format(15i5)
	stop
	end
c simple gcd 7.1.87
      function ngcd(m,n)
      if(m.ne.0)goto 70
      ngcd=iabs(n)
      return
 70   if(n.ne.0)goto 71
      ngcd=iabs(m)
      return
 71   m1=iabs(m)
      n1=iabs(n)
      ngcd=n1
    2 nr=mod(m1,ngcd)
      if(nr.eq.0)return
      m1=ngcd
      ngcd=nr
      goto 2
      end