Leonardo Number | A simple recursive program to find n - th leonardo number . ; Driver code
< ? php function leonardo ( $ n ) { $ dp [ 0 ] = $ dp [ 1 ] = 1 ; for ( $ i = 2 ; $ i <= $ n ; $ i ++ ) $ dp [ $ i ] = $ dp [ $ i - 1 ] + $ dp [ $ i - 2 ] + 1 ; return $ dp [ $ n ] ; } echo leonardo ( 3 ) ; ? >