var t; | |
for (var i = 0; i < vmax; i++){ | |
av = av * a; | |
} | |
for (var k = 1; k <= N; k++) { | |
t = k; | |
if (kq >= a) { | |
do { | |
t = t / a; | |
v--; | |
} while ((t % a) == 0); | |
kq = 0; | |
} | |
kq++; | |
num = mul_mod(num, t, av); | |
t = 2 * k - 1; | |
if (kq2 >= a) { | |
if (kq2 == a) { | |
do { | |
t = t / a; | |
v++; | |
} while ((t % a) == 0); | |
} | |
kq2 -= a; | |
} | |
den = mul_mod(den, t, av); | |
kq2 += 2; | |
if (v > 0) { | |
t = inv_mod(den, av); | |
t = mul_mod(t, num, av); | |
t = mul_mod(t, k, av); | |
for (var i = v; i < vmax; i++){ | |
t = mul_mod(t, a, av); | |
} | |
s += t; | |
if (s >= av){ | |
s -= av; | |
} | |
} | |
} | |
t = pow_mod(10, n - 1, av); | |
s = mul_mod(s, t, av); | |
Friday, August 6, 2010
pie
{{bliparr.length-1}} comments
Stay in touch with the conversation, follow to the wave for comments on this post . You can also invite someone to this wave .
Subscribe to:
Post Comments (Atom)
{{blip.html}}