diff options
Diffstat (limited to 'progs/a892.py')
-rw-r--r-- | progs/a892.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/progs/a892.py b/progs/a892.py new file mode 100644 index 0000000..85d0cd6 --- /dev/null +++ b/progs/a892.py @@ -0,0 +1,7 @@ +def jacobsthal_lucas(n):
+ dp=[0] * (n + 1)
+ dp[0] = 2
+ dp[1] = 1
+ for i in range(2, n+1):
+ dp[i] = dp[i - 1] + 2 * dp[i - 2];
+ return dp[n]
\ No newline at end of file |