+0  
 
0
856
2
avatar
3^7338 mod 310448767 yields "Error: Unknown Function 'mod'" on the calculator,
though other smaller numbers work fine. I just tried it with this and got 244095518,
was looking for something to verify it with... Cheers.

unsigned long long long_pow_mod(unsigned long long base,
unsigned long long exponent,
unsigned long long modulus) {
unsigned long long result = 1;
while (exponent) {
if (exponent & 1) {
result = result * base % modulus;
}
exponent = exponent >> 1;
base = base * base % modulus;
}
return result;
}
 Aug 6, 2013
 #1
avatar+104 
0
For the base 3 you'll have to use an exponent <= 646
[input]((3^646 mod 310448767))^11 * 3^232 mod 310448767[/input]
 Aug 6, 2013
 #2
avatar+3146 
0
Gorf:

3^7338 mod 310448767 yields "Error: Unknown Function 'mod'"



thanks for your feedback! the mod function now supports larger arguments:

[input]3^7338 mod 310448767[/input]
 Aug 6, 2013

1 Online Users

avatar