21 lines
400 B
Text
21 lines
400 B
Text
dim M(42)
|
|
M[0] = 1 : M[1] = 1
|
|
print rjust("1",18) : print rjust("1",18)
|
|
|
|
for n = 2 to 41
|
|
M[n] = M[n-1]
|
|
for i = 0 to n-2
|
|
M[n] += M[i]*M[n-2-i]
|
|
next i
|
|
print rjust(string(M[n]),18); chr(9);
|
|
if isPrime(M[n]) then print "is a prime" else print
|
|
next n
|
|
end
|
|
|
|
function isPrime(v)
|
|
if v <= 1 then return False
|
|
for i = 2 to int(sqr(v))
|
|
if v % i = 0 then return False
|
|
next i
|
|
return True
|
|
end function
|