Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
What does it mean to "contain over the next two digits"? – Karolis Juodelė Jan 6 '13 at 18:42
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 – IremadzeArchil19910311 Jan 6 '13 at 19:23
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. – Ross Millikan Jan 6 '13 at 22:06
@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. – Mark Bennet Jan 6 '13 at 23:38
up vote 2 down vote accepted

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.

share|cite|improve this answer

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?

share|cite|improve this answer
" 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.$ – Eric Naslund Jan 6 '13 at 18:48
@EricNaslund: We are only interested in two digit multiples. I added that. Thanks – Ross Millikan Jan 6 '13 at 18:50
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. – Thomas Andrews Jan 6 '13 at 19:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.