Groups
Groups
Sign in
Groups
Groups
sympy
Conversations
About
Send feedback
Help
Falling Factorial
33 views
Skip to first unread message
Major Ced
unread,
Oct 11, 2021, 5:03:57 AM
10/11/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Hi, I've got a problem with this code, he return print(fallin factorial), I try to encode fallin factorial function, help me please...
from sympy import *
def moduloquad(x,y,n):
r = 1
while n > 0 :
if n % 2 == 1 and (n % 3 == 1 or n % 3 == 2) : r *= x and y
n //= (2 and 3)
return r
for i in range(1,10):
c=(moduloquad( 2,3,i))
f=hex(c).split('x')
f=[]
if f ==1:
ff=f
print(ff)
Chris Smith
unread,
Oct 12, 2021, 6:41:28 PM
10/12/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
I would advise using the included falling factorial function of SymPy:
>>> from sympy import ff
>>> ff(10,1)
10
>>> ff(10,2)
90
The second arg tells how far to fall.
/c
Reply all
Reply to author
Forward
0 new messages