Skip to content

Commit

Permalink
Add a reference and examples for __getitem__
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuhei-mori committed Nov 28, 2023
1 parent 3cfec74 commit 486c776
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/doc/en/reference/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,11 @@ REFERENCES:
*Guide to using plantri*, version 5.0, 2016.
http://cs.anu.edu.au/~bdm/plantri/plantri-guide.txt
.. [BM2021] Alin Bostan and Ryuhei Mori,
*A simple and fast algorithm for computing the N-th term of a linearly recurrent sequence*,
Proceedings of Symposium on Simplicity in Algorithms (SOSA), pp. 118--132, 2021.
:doi:`10.1137/1.9781611976496.14`
.. [BMBFLR2008] A. Blondin-Massé, S. Brlek, A. Frosini, S. Labbé,
S. Rinaldi, *Reconstructing words from a fixed
palindromic length sequence*, Proc. TCS 2008, 5th IFIP
Expand Down
8 changes: 8 additions & 0 deletions src/sage/rings/cfinite_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,14 @@ def __getitem__(self, key):
[0, 0, 1, 2, 3, 4, 5, 6, 7, 8]
sage: s = C(x^3 * (1 - x)^-2); s[0:10]
[0, 0, 0, 1, 2, 3, 4, 5, 6, 7]
sage: s = C(1/(1-x^1000)); s[10^18]
1
sage: s = C(1/(1-x^1000)); s[10^20]
1
REFERENCES:
- [BM2021]_
"""
if isinstance(key, slice):
m = max(key.start, key.stop)
Expand Down

0 comments on commit 486c776

Please sign in to comment.