document.write( "Question 1177781: One hundred people are standing in a line and they are required to count off in fives as 'one, two, three, four, five,\" and so on from the first person in the line. Anyone who counts \"five\" walks out of the line. Those remaining repeat this procedure until only four people remain in the line. What was the original position in the line of the last person to leave? \n" ); document.write( "
Algebra.Com's Answer #806912 by math_helper(2461)\"\" \"About 
You can put this solution on YOUR website!

\n" ); document.write( "The 98th person in line at the start will be last person to leave\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "Line lengths go as follows (N=number of iterations):\r
\n" ); document.write( "\n" ); document.write( "N Length Last in line
\n" ); document.write( "- ------ ------------
\n" ); document.write( "0 100 100 <<< starting condition
\n" ); document.write( "1 80 99
\n" ); document.write( "2 64 98
\n" ); document.write( "3 52 98
\n" ); document.write( "4 42 98
\n" ); document.write( "5 34 98
\n" ); document.write( "6 28 98
\n" ); document.write( "7 23 98
\n" ); document.write( "8 19 98
\n" ); document.write( "9 16 98
\n" ); document.write( "10 13 98
\n" ); document.write( "11 11 98
\n" ); document.write( "12 9 98
\n" ); document.write( "13 8 98
\n" ); document.write( "14 7 98
\n" ); document.write( "15 6 98
\n" ); document.write( "16 5 98\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "You can see that only when the line length, L, meets the condition
\n" ); document.write( "(L mod 5 = 0) does the highest positioned person get ejected from
\n" ); document.write( "the line. This only happens for line lengths 100 and 80 which results
\n" ); document.write( "in 98 sticking at the end of the line all the way down to length = 5\r
\n" ); document.write( "\n" ); document.write( " \n" ); document.write( "
\n" );