Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/Partition-function-P/Maple/partition-function-p.maple
Normal file
30
Task/Partition-function-P/Maple/partition-function-p.maple
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
p:=proc(n)
|
||||
option remember;
|
||||
local k,s:=0,m;
|
||||
for k from 1 while (m:=iquo(k*(3*k-1),2))<=n do
|
||||
s-=(-1)^k*p(n-m);
|
||||
od;
|
||||
for k from 1 while (m:=iquo(k*(3*k+1),2))<=n do
|
||||
s-=(-1)^k*p(n-m);
|
||||
od;
|
||||
s
|
||||
end:
|
||||
p(0):=1:
|
||||
|
||||
time(p(6666));
|
||||
# 0.796
|
||||
|
||||
time(combinat[numbpart](6666));
|
||||
# 0.406
|
||||
|
||||
p~([$1..20]);
|
||||
# [1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, 627]
|
||||
|
||||
combinat[numbpart]~([$1..20]);
|
||||
# [1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, 627]
|
||||
|
||||
p(1000)
|
||||
# 24061467864032622473692149727991
|
||||
|
||||
combinat[numbpart](1000);
|
||||
# 24061467864032622473692149727991
|
||||
Loading…
Add table
Add a link
Reference in a new issue