28 lines
349 B
Plaintext
28 lines
349 B
Plaintext
print "F sequence."
|
|
for i = 0 to 20
|
|
print f(i);" ";
|
|
next
|
|
print
|
|
print "M sequence."
|
|
for i = 0 to 20
|
|
print m(i);" ";
|
|
next
|
|
|
|
end
|
|
|
|
function f(n)
|
|
if n = 0 then
|
|
f = 1
|
|
else
|
|
f = n - m(f(n - 1))
|
|
end if
|
|
end function
|
|
|
|
function m(n)
|
|
if n = 0 then
|
|
m = 0
|
|
else
|
|
m = n - f(m(n - 1))
|
|
end if
|
|
end function
|