用个递归算法就OK了,并且可以计算任意An的值dim n as longprivate function A(n as long) as long
select case n
case 1,2
A=1
case 3
A=2
case else
A=A(n-3)+2*A(n-2)+A(n-1) '递归算法核心
end selectend functionform1.print A(N) 'N随你取,比如A(23),注意要把form的属性autoRedraw设置为true,不然用以下两个语句也可以'debug.print A(N)'msgbox A(N)