Recent content by wrong_class

  1. W

    Finding primitive roots using python

    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
  2. W

    Finding primitive roots using python

    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...
  3. W

    Finding primitive roots using python

    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...
  4. W

    Finding primitive roots using python

    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 =...
  5. W

    Finding primitive roots using python

    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...
  6. W

    PN junction current equation

    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?
  7. W

    Weird Dot Product Homework Q: Unusual Answer?

    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' ?
  8. W

    Weird Dot Product Homework Q: Unusual Answer?

    so the integrals are different. So why did someone who learned this already tell me these two are the same? thats the answer I am getting. thanks!
  9. W

    Weird Dot Product Homework Q: Unusual Answer?

    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...
  10. W

    LC Ocillations given only one piece of data

    if the period is 2pi, then it would be at T = pi/2? edit: forget it. it was a "N". my mistake
  11. W

    LC Ocillations given only one piece of data

    T/4. so.. divide my answer by 4?
  12. W

    How can I use the range equation to find the initial velocity of a projectile?

    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
Back
Top