Skip to content

Commit a0fd815

Browse files
authored
Update sloane_functions.py
using Partitions
1 parent 0788930 commit a0fd815

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sage/combinat/sloane_functions.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,10 +600,8 @@ def _eval(self, n):
600600
sage: [sloane.A000008._eval(n) for n in range(14)]
601601
[1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 11, 12, 15, 16]
602602
"""
603-
from sage.rings.lazy_series_ring import LazyPowerSeriesRing
604-
x = LazyPowerSeriesRing(ZZ, 'x').gen()
605-
p = 1/((1-x)*(1-x**2)*(1-x**5)*(1-x**10))
606-
return ZZ(p.coefficient(n))
603+
from sage.combinat.partition import Partitions
604+
return Partitions(n, parts_in=[1, 2, 5, 10]).cardinality()
607605

608606

609607
class A000009(SloaneSequence):

0 commit comments

Comments
 (0)