Skip to content

Commit 21ed597

Browse files
committed
Trac #21343: fix doctest some_elements
1 parent 3b0f9d0 commit 21ed597

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

src/sage/combinat/k_regular_sequence.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,13 +1122,14 @@ def some_elements(self):
11221122
11231123
sage: tuple(kRegularSequenceSpace(2, ZZ).some_elements())
11241124
(2-regular sequence 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, ...,
1125-
2-regular sequence 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...,
1126-
2-regular sequence 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...,
1127-
2-regular sequence -2, -4, 4, -8, -4, 8, 8, -16, 4, -8, ...,
1128-
2-regular sequence 1, 2, 2, 4, 2, 2, 4, 8, 2, 2, ...,
1129-
2-regular sequence 2, 11, 14, 20, 17, 23, 23, 29, 20, 26, ...,
1125+
2-regular sequence 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, ...,
1126+
2-regular sequence 1, 1, 0, 1, -1, 0, 0, 1, -2, -1, ...,
1127+
2-regular sequence 2, -1, 0, 0, 0, -1, 0, 0, 0, 0, ...,
1128+
2-regular sequence 1, 1, 0, 1, 5, 0, 0, 1, -33, 5, ...,
1129+
2-regular sequence -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...,
1130+
2-regular sequence -59, -20, 0, -20, 0, 0, 0, -20, 0, 0, ...,
11301131
...
1131-
2-regular sequence 1, 10, 10, 100, 10, 10, 100, 1000, 10, 10, ...)
1132+
2-regular sequence 2210, 170, 0, 0, 0, 0, 0, 0, 0, 0, ...)
11321133
"""
11331134
return super(kRegularSequenceSpace, self).some_elements(heal=True)
11341135

src/sage/combinat/recognizable_series.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,21 +1636,12 @@ def some_elements(self, **kwds):
16361636
16371637
EXAMPLES::
16381638
1639-
sage: tuple(RecognizableSeriesSpace(ZZ, [0, 1]).some_elements())
1640-
([1] + [01] + [10] + 2*[11] + [001] + [010]
1641-
+ 2*[011] + [100] + 2*[101] + 2*[110] + ...,
1642-
[] + [0] + [1] + [00] + [01] + [10]
1643-
+ [11] + [000] + [001] + [010] + ...,
1644-
0,
1645-
-2*[] + 2*[0] - 4*[1] - 2*[00] + 4*[01] + 4*[10]
1646-
- 8*[11] + 2*[000] - 4*[001] - 4*[010] + ...,
1647-
[] + [0] + 2*[1] + [00] + 2*[01] + [10]
1648-
+ 4*[11] + [000] + 2*[001] + [010] + ...,
1649-
2*[] + 5*[0] + 11*[1] + 8*[00] + 14*[01] + 14*[10]
1650-
+ 20*[11] + 11*[000] + 17*[001] + 17*[010] + ...,
1651-
...
1652-
[] + [0] + 10*[1] + [00] + 10*[01] + [10]
1653-
+ 100*[11] + [000] + 10*[001] + [010] + ...)
1639+
sage: tuple(RecognizableSeriesSpace(ZZ, [0, 1]).some_elements())[:5]
1640+
([1] + [01] + [10] + 2*[11] + [001] + [010] + 2*[011] + [100] + 2*[101] + 2*[110] + ...,
1641+
[] + [1] + [11] + [111] + [1111] + [11111] + [111111] + [1111111] + [11111111] + [111111111] + ...,
1642+
[] + [0] + [1] + [00] + [10] + [11] + [000] - 1*[001] + [100] + [110] + ...,
1643+
2*[] - 1*[1] + 2*[10] - 1*[101] + 2*[1010] - 1*[10101] + 2*[101010] - 1*[1010101] + 2*[10101010] - 1*[101010101] + ...,
1644+
[] + [1] + 6*[00] + [11] - 39*[000] + 5*[001] + 6*[100] + [111] + 288*[0000] - 33*[0001] + ...)
16541645
"""
16551646
from itertools import count, islice
16561647
from sage.matrix.matrix_space import MatrixSpace

0 commit comments

Comments
 (0)