Skip to content

Instantly share code, notes, and snippets.

@idoushiki
Last active April 9, 2018 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idoushiki/7f91ec7f6ae6229fe23e30f2db698447 to your computer and use it in GitHub Desktop.
Save idoushiki/7f91ec7f6ae6229fe23e30f2db698447 to your computer and use it in GitHub Desktop.
<html>
<script>
max=6;
for(p=1;p<=max;p++){
for(h=1;h<=max;h++){
for(a=1;a<=max;a++){
for(b=1;b<=max;b++){
print(p,h,a,b);
}
}
}
}
function print(p,h,a,b){
fl=0;
ka=(p**a)%h;
kb=(p**b)%h;
kka=(ka**b)%h;
kkb=(kb**a)%h;
br();
document.write("ka=");
document.write(ka);
br();
document.write("kb=");
document.write(kb);
br();
if(kka!=kkb){
document.write("no");
exit;
}
else if(kka!=0&&kkb!=0){
br();
document.write(kka);
document.write(" ");
document.write(kkb);
br();
}
}
function br(){
document.write("<br>");
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment