I just entered this into the calc
mod(64^235,391)
(64235)mod(391)=4
I don't know how to do this without the calc
Notice the pattern, Melody
64^15 mod 391 = 4
64^59mod 391 = 4
64^103mod 391 = 4
Which leads us to believe that this pattern repeats every 44th power
Therefore
64^(15 + 44n)mod 391 = 4 for all positive integers, n
So
64^(15 + 44*5)mod 391 = 64^(15 + 220)mod 391 = 64^(235)mod 391 = 4 ....!!!
Actually, zegroes, there was some "brute force" required in my answer.....I just thought it was an interesting pattern......LOL!!!
its ok chris you can admit it i mean its only right the dinosaur gets school by the much wiser(OLDER) person here aka the Fossil!
64^235 mod 391
64235mod391=(645)47mod391|(645)mod391=302=(302)47mod391=3022∗(302)45mod391=3022∗(3023)15mod391|(3023)mod391=4=3022∗415mod391=3022∗(43)5mod391|43=64=3022∗(64)5mod391|(645)mod391=302=3022∗302mod391=3023mod391|(3023)mod391=4=4mod391
Thanks Heureka, I'll try and remember that. :)
Thanks Chris but I think Heureka's makes mores sense. :))
It's just a different approach....whether it "makes more sense" is debatable....
I think that mine is perfectly valid....
see: For example:
http://dimacs.rutgers.edu/Workshops/Security/program2/quisquater/node3.html
long modulo( long b, long x, long n) { // b = basic, x = exponent, n = modulo
long z=1; b=b % n;
while (x !=0) {
if (x%2 !=0) z = (z*b)%n; // Exponent odd
b =(b*b)% n; x = x/2;
} // while
return z;
}
Square and Multiply Algorithm:
64235mod391
Exponentz=164mod391=64=b235 odd:1∗64⏟=z∗bmod391=64=z(64⏟=b)2mod391=186=b:2117 odd:64∗186⏟=z∗bmod391=174=z(186⏟=b)2mod391=188=b:258 even:(188⏟=b)2mod391=154=b:229 odd:174∗154⏟=z∗bmod391=208=z(154⏟=b)2mod391=256=b:214 even:(256⏟=b)2mod391=239=b:27 odd:208∗239⏟=z∗bmod391=55=z(239⏟=b)2mod391=35=b:23 odd:55∗35⏟=z∗bmod391=361=z(35⏟=b)2mod391=52=b:21 odd:361∗52⏟=z∗bmod391=4=z(52⏟=b)2mod391=358=b:20 end