Loading [MathJax]/jax/output/SVG/jax.js
 
+0  
 
0
1886
17
avatar

64^235 mod 391

 Feb 4, 2015
 #1
avatar+118696 
+5

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  

 Feb 4, 2015
 #2
avatar+130458 
+10

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 ....!!!

 

 Feb 4, 2015
 #3
avatar+3502 
-2

uh oh did melody just get schooled by chris....?

 Feb 4, 2015
 #4
avatar+130458 
0

Actually, zegroes, there was some "brute force" required in my answer.....I just thought it was an interesting pattern......LOL!!!

 

 Feb 4, 2015
 #5
avatar+3502 
-3

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!

 Feb 4, 2015
 #6
avatar+130458 
0

LOL!!!

 

 Feb 4, 2015
 #7
avatar+26396 
+10

64^235 mod 391

 64235mod391=(645)47mod391|(645)mod391=302=(302)47mod391=3022(302)45mod391=3022(3023)15mod391|(3023)mod391=4=3022415mod391=3022(43)5mod391|43=64=3022(64)5mod391|(645)mod391=302=3022302mod391=3023mod391|(3023)mod391=4=4mod391 

 Feb 5, 2015
 #8
avatar+118696 
+3

Thanks Heureka, I'll try and remember that.  :) 

Thanks Chris but I think Heureka's makes mores sense. :))

 Feb 5, 2015
 #9
avatar+118696 
+8

I have tucked this one away in "reference material"  

 Feb 5, 2015
 #10
avatar+130458 
0

It's just a different approach....whether it "makes more sense" is debatable....

I think that mine is perfectly valid....

 

 Feb 5, 2015
 #11
avatar+26396 
+10

See:

Square-and-Multiply-Algorithm with modulo for any bxmodn

 Feb 5, 2015
 #12
avatar+118696 
0

Is that meant to take me somewhere Heureka??

 Feb 5, 2015
 #14
avatar+118696 
0

Thanks Heureka 

 Feb 5, 2015
 #15
avatar+26396 
+5

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;

}

 Feb 5, 2015
 #16
avatar+26396 
+5

Square and Multiply Algorithm:

 

64235mod391

 

 Exponentz=164mod391=64=b235 odd:164=zbmod391=64=z(64=b)2mod391=186=b:2117 odd:64186=zbmod391=174=z(186=b)2mod391=188=b:258 even:(188=b)2mod391=154=b:229 odd:174154=zbmod391=208=z(154=b)2mod391=256=b:214 even:(256=b)2mod391=239=b:27 odd:208239=zbmod391=55=z(239=b)2mod391=35=b:23 odd:5535=zbmod391=361=z(35=b)2mod391=52=b:21 odd:36152=zbmod391=4=z(52=b)2mod391=358=b:20 end 

 Feb 5, 2015
 #17
avatar+118696 
0

Thanks once agaain Heureka 

 Feb 5, 2015

2 Online Users

avatar