write a program to print fibonaaci series like 2,1,3,4,7,11,18 up to 10th term using function...end function

I did it using SUB..end sub in this way :
declare sub series
cls
call series
end
sub series
a=2
b=1
for p =1 to 5
print a; b
a=a + b
b=b + a
next p
end sub

How do you do it using FUNCTION...END FUNCTION
0 following

use the function to calculate the nth fib #, and return its value.

Then loop for p=1..5 and print each value returned.