Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A way to calculate (n^x)/d

  1. Jun 8, 2013 #1
    Hi, I've recently found the following algorithm and I'm willing to share it:

    For example, given an integer n=46, an exponent x=5, and d=13, we have 465/13.
    First, we set the equation, n = q*d + r = q*13 + r
    We have, 46 = 3*13 + 7
    Thus, [q=3, r=7, d=13]
    And: 465/13 = 3*464 + 7*(3*463 + 7*(3*462 + 7*(3*461 + 7*(46/13))))

    Let [q, r, d] and we have (n^4)/d, then:
    (n^4)/d = q*n^(4-1) + r*(q*n^(4-2) + r*(q*n^(4-3) + r*(n/d)))

    I don't know if it's interesting to you or not, but what are your thoughts about it?
     
  2. jcsd
  3. Jun 10, 2013 #2

    Stephen Tashi

    User Avatar
    Science Advisor

    Perhaps you'll get more comments if you write the expression in a less computationally efficient manner.

    [itex] \frac{(qd + r)^5}{d} = q(qd+r)^4 + rq(qd+r)^3 + r^2q(qd+r)^2 + r^3q(qd+r) + r^4\frac{(qd+r)}{d} [/itex]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: A way to calculate (n^x)/d
  1. M - (x -n)^2 = ? (Replies: 16)

  2. X^n +y^n (Replies: 5)

  3. X^x = n, value of x? (Replies: 5)

  4. Confusion about -x^n (Replies: 7)

Loading...