document.write( "Question 1207684: Find all integers $n$, $0 \le n < 163$, such that $n$ is its own inverse modulo $8.$ \n" ); document.write( "
Algebra.Com's Answer #845715 by math_tutor2020(3817)\"\" \"About 
You can put this solution on YOUR website!

\n" ); document.write( "Tutor ikleyn has pointed out that n^2 = 1 (mod 8) has solutions:
\n" ); document.write( "n = 1, n = 3, n = 5, n = 7\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The interesting thing is that the n = 1 and n = 7 cases pair up.
\n" ); document.write( "Notice how n = 7 is one short of 8, so we can think of it like n = -1 in mod 8.
\n" ); document.write( "Squaring -1 will generate +1 or simply 1. \r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Similarly, the n = 3 and n = 5 cases pair up together.
\n" ); document.write( "Notice n = 5 is three short of 8, in which we can think of it like n = -3 (mod 8). Squaring this leads to +9 = 9 = 1 (mod 8).\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "--------------------------------------------------------------------------\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Slight tangent aside, the four classes of solutions were
\n" ); document.write( "n = 1, n = 3, n = 5, n = 7\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Your teacher is asking you to look through the interval \"0+%3C=+n+%3C+163\" to see which of those values of n work or not.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Let's focus on the n = 1 case.
\n" ); document.write( "This is when the numbers are of the form 8k+1, since each produces remainder 1 in mod 8.
\n" ); document.write( "Look at a few values of k.
\n" ); document.write( "n = 8k+1 = 8*0+1 = 1
\n" ); document.write( "n = 8k+1 = 8*1+1 = 9
\n" ); document.write( "n = 8k+1 = 8*2+1 = 17
\n" ); document.write( "n = 8k+1 = 8*3+1 = 25
\n" ); document.write( "Another way to generate this sequence is to start at 1, and add 8 to each term.
\n" ); document.write( "The question is now: when does this subsequence stop?
\n" ); document.write( "Let's set it equal to 163 and see what happens.
\n" ); document.write( "8k+1 = 163
\n" ); document.write( "8k = 163-1
\n" ); document.write( "8k = 162
\n" ); document.write( "k = 162/8
\n" ); document.write( "k = 20.25
\n" ); document.write( "If k = 20 then 8k+1 = 8*20+1 = 161
\n" ); document.write( "If k = 21 then 8k+1 = 8*21+1 = 167
\n" ); document.write( "Therefore the highest we can go in this congruence class is 161.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "All of these values
\n" ); document.write( "{1, 9, 17, ..., 153, 161}
\n" ); document.write( "fit the n = 1 congruence class and are a subset of the overall solution space.
\n" ); document.write( "When dividing each of those items over 8, we'll get some quotient with remainder 1.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "You will follow similar ideas for n = 3, n = 5, and n = 7.
\n" ); document.write( "I'll let the student determine those.
\n" ); document.write( "
\n" ); document.write( "
\n" );