Riordan numbers: Difference between revisions

no edit summary
No edit summary
Line 416:
834086421 2358641376 6684761125 18985057351
54022715451 154000562758 439742222071 1257643249140</pre>
 
 
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
_limit = 31
 
local fn Riordan( n as long, a(_limit) as long )
long i
if ( n >= 0 )
a(0) = 1
if ( n >= 1 )
a(1) = 0
for i = 2 to n
a(i) = ( ( i - 1 ) * ( ( 2 * a(i-1) ) + ( 3 * a(i-2) ) ) ) / ( i + 1 )
next
end if
end if
end fn
 
long i, count = 0, r(_limit)
printf @"First 32 Riordan numbers:"
fn Riordan( _limit, r(0) )
 
for i = 0 to 23
printf @"%16ld\b", r(i)
count++
if count mod 4 == 0 then print
next
 
count = 0
for i = 24 to _limit
printf @"%16s\b", fn StringUTF8String( Str(r(i)) )
count++
if count mod 4 == 0 then print
next
 
NSLog( @"%@", fn WindowPrintViewString( 1 ) )
 
HandleEvents
</syntaxhighlight>
{{output}}
<pre>
First 32 Riordan numbers:
1 0 1 1
3 6 15 36
91 232 603 1585
4213 11298 30537 83097
227475 625992 1730787 4805595
13393689 37458330 105089229 295673994
834086421 2358641376 6684761125 18985057351
54022715451 154000562758 439742222071 1257643249140
</pre>
 
 
=={{header|Haskell}}==
717

edits