can you show me? I am not seeing it. I didnt put this in, but later on, I am going to be choosing a random value from the primitive roots to use for calculations
hm... you gave me an idea...since i don't need the actual list, i'll calculate the actual totient value, rather than the set that makes them up. i do need the list, which is a problem
im using values up to 2048 bits. since the values I am getting are changed so that they become the closest...
def gcd(a, b):
a, b = max(a, b), min(a, b)
c = 1
while c:
c = a % b
a = b
b = c
return a
def tot(n):
phi = []
x = 1
while x < n:# not for x in xrange(n) because the input is too big for xrange
if gcd(x, n) == 1:
phi += [x]
x += 1
return phi
pow is the built in command...
Im not using any library at all. I like to write programs with as few outside sources as possible.
my code is currently:
def prim_root(value):
# `tot` gets the list of values coprime to the input,
# so len(tot()) is the correct totient value
totient = tot(value)
roots = []
exp =...
Im not sure if this should go in the math/number theory section or here, but here it goes:
how do programs calculate the primitive roots mod n of extremely large primes? My program will only go up to 12-14 bits before having memory errors caused by storage of the totient of the prime number...
What are e and V in exponent of the equation I = I0(eeV/kT - 1)? is it really one variable "eV", as in electron volts, or is e just 2.718... and V for volts?
can someone clarify this for me?:
given r(t) is a vector, how do you find the line integral if f(x(t),(y(t)) returns a scalar? A vector? do you always get 2 scalars (magnitude of f and magnitude of r' ) and multiply them? do you take the gradient if f is scalar and then dot deL_f and r' ?
Homework Statement
i have the vector m(x(t), y(t)) = r = (s^t cos(t), e^t sin(t)) and want to find the line integral of itHomework Equations
1. \int m \centerdot r' dt
2. \int |m| |r'| dtThe Attempt at a Solution
the answer is sqrt(2)/2 (e^pi - 1). when i do the problem the first way, i do not...
You know the x distance: x0 = 0, xf = 23m, so 23 = Vx * t gives you Vx
you have the y time: solve for Vy with 0 = Dy(t). there will be 2 answers: 0 and the Vy you are looking for