document.write( "Question 1045922: Zaina is curios about numbers that contain the number 2,0,1,6 in that exact sequence she insists that the digits 2,0,1,6 only occur once in the numbers. She calls such a number a \"year number\". for example 20163 and 320164 are year numbers but 12016 and 21069 are not year numbers. Find the 2016th Year number. \n" ); document.write( "
Algebra.Com's Answer #661534 by KMST(5328)\"\" \"About 
You can put this solution on YOUR website!
Luckily we are in the 2010's, and luckier yet, Zaina wants the digits 2, 0, 1, and 6 to appear only once. That makes it easier.
\n" ); document.write( "It is easier to think through than to explain, but I will try.
\n" ); document.write( "The first year number is, of course 2016. That is \"1\" year number.
\n" ); document.write( "Next come the 5-digit numbers that we can make by adding one of the remaining 6 digits (3, 4, 5, 7, 8, and 9) to the back of 2016. That is \"6\" more.
\n" ); document.write( "Then come the 5-digit numbers that we can make by adding one of the remaining 6 digits to the front of 2016.
\n" ); document.write( "That is another \"6\" numbers, for a total of \"2%2A6=12\" 5-digit year numbers.
\n" ); document.write( "After that, we have 6-digit year numbers formed by adding a 2-digit sequence to 2016.
\n" ); document.write( "There are \"6%5E2=36\" 2-digit sequences that can be formed with the digits 3, 4, 5, 7, 8, and 9,
\n" ); document.write( "and there are \"3\" ways to add them to 2016. We can attach the last 2, 1, or 0 of the digits in a sequence to the back of 2016, and put the remainder of the sequence at the front.
\n" ); document.write( "That gives us \"3%2A36=108\" 6-digit year numbers.
\n" ); document.write( "We can also make 7-digit year numbers that will be larger than all the 6-digit year numbers.
\n" ); document.write( "We make them by adding to 2016 3-digit sequences made from the digits 3, 4, 5, 7, 8, and 9.
\n" ); document.write( "There are \"6%5E3=216\" such sequences, from 333 to 999,
\n" ); document.write( "and we can add them by including he first 0, 1, 2, or 3 digits to the front of 2016, and the rest of the sequence to the back of 2016.
\n" ); document.write( "That is \"4\" ways, and gives us \"4%2A216=864\" 7-digit year numbers.
\n" ); document.write( "So far, we have \"1%2B12%2B108%2B864=985\" year numbers with 7 digits or less.
\n" ); document.write( "The largest of those is 9992016,which is The 985th year number.
\n" ); document.write( "There are a lot of 8-digit year numbers, and among those will be the 2016th year number.
\n" ); document.write( "To get to the 2016th year number, we just need to form the smallest \"2016-985=1031\" 8-digit year numbers.
\n" ); document.write( "We make 8-digit year numbers by adding a 4-digit sequence to 2016.
\n" ); document.write( "With the 6 digits 3, 4, 5, 7, 8, and 9, we can make \"6%5E4=1296\" such sequences,
\n" ); document.write( "from 3333 to 9999.
\n" ); document.write( "The \"1296\" 8-digit year numbers by adding a 4-digit sequence to 2016
\n" ); document.write( "formed by adding all digits in those 4-digit sequences to the back of 2016,
\n" ); document.write( "20163333 to 20169999 are the smallest.
\n" ); document.write( "The 8-digit year numbers formed by including one or more digits from those 4-digit sequences at the front 2016 start at 32016333, which is larger than 20169999.
\n" ); document.write( "The question now is which of the 4 digit sequences from 3333 to 9999 is the 1031st.
\n" ); document.write( "If we count the first 8-digit year number, 20163333, as our element \"red%280%29\" ,
\n" ); document.write( "we are looking for element \"red%281030%29\" .
\n" ); document.write( "In a base 6 system, using only the 6 characters 0, 1, 2, 3, 4, and 5.
\n" ); document.write( "the base 10 number \"red%281030%29\" is written as \"green%284434%29\" ,
\n" ); document.write( "because .
\n" ); document.write( "We cannot use the digits 2, 0, 1, or 6, so we would use.
\n" ); document.write( "\"3\" instead of \"green%280%29\" ,
\n" ); document.write( "\"4\" instead of \"green%281%29\" ,
\n" ); document.write( "\"5\" instead of \"green%282%29\" ,
\n" ); document.write( "\"7\" instead of \"green%283%29\" ,
\n" ); document.write( "\"8\" instead of \"green%284%29\" , and
\n" ); document.write( "\"9\" instead of \"green%285%29\" .
\n" ); document.write( "The first 8-digit year number, our element number \"red%280000%29\" in our usual base 10 system,
\n" ); document.write( "is element number \"green%280000%29\" in the base 6 system using the digits \"green%280%29\" to \"green%285%29\" ,
\n" ); document.write( "and is element \"3333\" in base 6 when our characters are 3, 4, 5, 7, 8, and 9, and those are the last 4 digits of the first 8-digit year number.
\n" ); document.write( "The 1031st 8-digit year number, our element number \"red%281030%29\" in a base 10 numbering system,
\n" ); document.write( "element number \"green%284434%29\" in a base 6 numbering system using the digits \"green%280%29\" to \"green%285%29\" ,
\n" ); document.write( "is written as \"8878\" in base 6 when our characters are 3, 4, 5, 7, 8, and 9.
\n" ); document.write( "Those are the last 4 digits of the 1031st 8-digit year number.
\n" ); document.write( "So, the 2016th year number is formed by adding 8878 to the back of 2016.
\n" ); document.write( "The 2016th year number is \"highlight%2820168878%29\" .
\n" ); document.write( "
\n" );