option explicit
dim n as integer
private sub command1_click()
   dim a as integer,b as integer
   a=2:b=3
   for n=1 to 6
       if n mod 2 =0 then
              b=fun(n,a) +a
        else
            a=fun(b,n) +b
        end if
   next n
   print n,a ,b
end sub
private function fun (x as integer,y as integer) as integer
  x=y-1+n
  y=x+y-n
  fun =x+y
end function