diff options
Diffstat (limited to 'progs/a532.py')
-rw-r--r-- | progs/a532.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/progs/a532.py b/progs/a532.py new file mode 100644 index 0000000..dc8e817 --- /dev/null +++ b/progs/a532.py @@ -0,0 +1,10 @@ +def get_pell(n):
+ if (n <= 2):
+ return n
+ a = 1
+ b = 2
+ for i in range(3, n+1):
+ c = 2 * b + a
+ a = b
+ b = c
+ return b
\ No newline at end of file |