I know that there exists nine 2007 digit number where each two digit number is made up of two neighbor digits, those numbers are:

  1. $$12345678901234....90123456789012345678 $$
  2. $$23456789012345....01234567890123456789$$
  3. $$34567890123456....12345678901234567890$$
  4. $$45678901234567....23456789012345678801$$
  5. $$56789012345678....34567890123456789012$$
  6. $$67890123456789....45678901234567890123$$
  7. $$78901234567890....56789012345678901234$$
  8. $$89012345678901....67890123456789012345$$
  9. $$90123456789012....78901234567890123456$$

Why there is nine numbers? because number can not be started with '0' digit! Right?

Anyway I can not find out which numbers can be divided by 17 or 23 from this list? I have no idea how to get there. Any hints or ideas on how I should tackle this one?

  • 7
    $\begingroup$ What does it mean to "contain over the next two digits"? $\endgroup$ Jan 6, 2013 at 18:42
  • $\begingroup$ I mean numbers like this 12345 or this 5678. first digit plus one you get second digit. Second digit plus one you get third digit etc $\endgroup$ Jan 6, 2013 at 19:23
  • 1
    $\begingroup$ Do you need the whole number divisible by 17 or 23, or each pair of digits? My answer assumes the latter, but Thomas Andrews and Mark Bennet thought the former. $\endgroup$ Jan 6, 2013 at 22:06
  • $\begingroup$ @RossMillikan I didn't "think the former" I merely allowed for it, and perhaps I should have awaited clarification of a question which is rather obscure. $\endgroup$ Jan 6, 2013 at 23:38

2 Answers 2


I think the way to proceed is likely to be through a geometric progression. Note that the numbers as stated look to have 2008 digits. Terminate the first one with 7 rather than 8 and you will find that it comes out as:

$$1234567\times10^{2000}+8901234567\times (10^{1990}+10^{1980}+ \dots+1)$$

Then the reductions modulo 17 and 23 are easier - and by summing the geometric progression and applying Fermat's little theorem the result can be obtained fairly efficiently. Some efficiency is possible in tackling the 9 examples by making sure that parts common to all the calculations are reduced as far as possible before combining them with the numbers which vary from one line to the next.

Note: repeating patterns like this can often be handled efficiently as Geometric Progressions.


Hint: If you start with 1, the next digit must be 7 because no two digit multiples of 23 start with 1. Then you are stuck because no two digit multiples of 17 or 23 start with 7. If you start with 3, the next digit must be 4. Then the next must be 6 as 46 is divisible by 23. Then?

  • $\begingroup$ " If you start with 1, the next digit must be 7 because no multiples of 23 start with 1" I am not sure I understand that statement. $23*5=115$, $23*6=138$, $23*7=161.$ $\endgroup$ Jan 6, 2013 at 18:48
  • $\begingroup$ @EricNaslund: We are only interested in two digit multiples. I added that. Thanks $\endgroup$ Jan 6, 2013 at 18:50
  • 1
    $\begingroup$ It's not 100% clear, but it seems to me OP only wants the entire number divisible by 17 or 23, not each pair of two digits. $\endgroup$ Jan 6, 2013 at 19:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .