mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2007-08-23, 16:29   #1
mfgoode
Bronze Medalist
 
mfgoode's Avatar
 
Jan 2004
Mumbai,India

80416 Posts
Question The Millionth digit.



If you write the sequence of numbers one after the other in their natural order without separating them, as though one were writing a single number:
123456789101112131415...

Find what digit occupies a given position, say the millionth ?

I would prefer a non computer solution.

Mally
mfgoode is offline   Reply With Quote
Old 2007-08-23, 17:12   #2
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

2058 Posts
Default

A part of problem 40 at http://projecteuler.net/index.php. There are 9*10^(x-1) of x-digital numbers (x>=1).First find n for which sum of length of all numbers f(n) consists of no more then n digits, less and closest to 10^6. f(n)=sum(9*x*10^(x-1),i=1..n)=1/9*(1-10^n+9*n*10^n). For n=5, f(n)=488889 -the closest value less then 10^6. Then find the ammount of 6-digits numbers, which sum of length less and closest to 10^6-f(5)=511111,The number is [511111/6]=85185. Thus, we have that all digits of all numbers in range (1..185184 (cause the 100000 is the first 6-digits number)) are included in our sequence (no more then 10^6 digits). Number of digits of 185185 which lie in sequence is equal 511111-85185*6=1. Thus, the millionth digit of sequence is the first digit of 185185- which equals 1.

Last fiddled with by VolMike on 2007-08-23 at 17:34
VolMike is offline   Reply With Quote
Old 2007-08-23, 17:25   #3
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

7×19 Posts
Default

This problem can be solved in common case, but I suppose that symbolic result would be quite huge to be evaluated and posted there.
VolMike is offline   Reply With Quote
Old 2007-08-23, 19:35   #4
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

67028 Posts
Default

Here's a kinda neat way to get the solution using a similar type of sequence:

The millionth digit is given by the
(1000000 - (9 * 54321))%6 th digit of the
(1000000 - (9 * 54321))/6 th 6 digit number (which has already been pointed out to be 185185) or 1.

The trillionth digit is given by the
(1000000000000 - (9 * 10987654321))%11 th digit of the
(1000000000000 - (9 * 10987654321))/11 11 digit number (which is 81919191919) or 1.

In general, the Nth digit of the seqence is given by
this digit: (N - (9 * S(d-1)))%d
of the (N - (9 * S(d-1)))/d 'th d digit number.
Where S(n) is the reverse of the original sequence (i.e. S(5) = 54321), and d is the biggest number such that (9 * S(d-1)) < N.

Last fiddled with by bsquared on 2007-08-23 at 19:37
bsquared is offline   Reply With Quote
Old 2007-08-23, 20:01   #5
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·3·587 Posts
Default

Hmmm. I just tried this for N = 1e18 and it didn't work, and I know why. Apparently by "in general" I meant "in general for N < ~1e10"

my reverse sequence is built from the fact that you can count the number of digits in the original sequence like this:
for N = 1e6 there are:
9 numbers with 1 digit
90 numbers with 2 digits
900 with 3, etc

total digits = 9*1 + 90*2 + 900*3 ...
= 9 * (1 + 10*2 + 100*3 ...)
= 9 * (...321)

but after 9 digit numbers this isn't true anymore.

sorry for the confusion.
bsquared is offline   Reply With Quote
Old 2007-08-23, 21:02   #6
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

8516 Posts
Default

One way to get a better algorithm is simplifying 1/9*(1-10^n+9*n*10^n),or find a simpler formula for biggest positive integer n,satisfies 1/9*(1-10^n+9*n*10^n) < = t (t- position number of unknown digit). May be it is possible to calculate short formula for some special values of t=10^s (as in problem 40 at http://projecteuler.net/index.php.).
VolMike is offline   Reply With Quote
Old 2007-08-24, 16:13   #7
mfgoode
Bronze Medalist
 
mfgoode's Avatar
 
Jan 2004
Mumbai,India

22·33·19 Posts
Thumbs up

Quote:
Originally Posted by VolMike View Post
A part of problem 40 at http://projecteuler.net/index.php.

Thus, we have that all digits of all numbers in range (1..185184 (cause the 100000 is the first 6-digits number)) are included in our sequence (no more then 10^6 digits). Number of digits of 185185 which lie in sequence is equal 511111-85185*6=1. Thus, the millionth digit of sequence is the first digit of 185185- which equals 1.


You have it right Volmike.

To make it clearer, dividing by 6 we get the quotient 85,185 and the remainder 1, so the desired digit occupies the first place in the 85,186th. 6- digit number. Since the first 6- digit number is 100,000 the 85,186th is 185,185 whose first digit is 1.

Thanks for the website. The next time I submit a problem I will check it and give something that is not included there!

Mally
mfgoode is offline   Reply With Quote
Old 2007-08-24, 17:51   #8
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

2058 Posts
Default

Quote:
Originally Posted by mfgoode View Post


You have it right Volmike.

To make it clearer, dividing by 6 we get the quotient 85,185 and the remainder 1, so the desired digit occupies the first place in the 85,186th. 6- digit number. Since the first 6- digit number is 100,000 the 85,186th is 185,185 whose first digit is 1.

Thanks for the website. The next time I submit a problem I will check it and give something that is not included there!

Mally
Hm.. It seems that you (and others) post problems not only because you really need the answer, but to "shake up" the forum and make some kind of competition? If so, I start like this forum more and more :)

Last fiddled with by VolMike on 2007-08-24 at 17:52
VolMike is offline   Reply With Quote
Old 2007-08-25, 08:42   #9
mfgoode
Bronze Medalist
 
mfgoode's Avatar
 
Jan 2004
Mumbai,India

22×33×19 Posts
Thumbs up A Shake Up!

Quote:
Originally Posted by VolMike View Post
Hm.. It seems that you (and others) post problems not only because you really need the answer, but to "shake up" the forum and make some kind of competition? If so, I start like this forum more and more :)


You are dead right Vol. Speaking for myself yes I do. The aim is to test your knowledge and skill on important parts of Number theory and other topics
by putting it in the form of a puzzle.

You may be interested to know that in presenting a problem for the forum I came across an original theorem. I developed it as no one seemed to have solved it and have presented a paper for publication. I have also claimed that by it I have solved the Beal's conjecture. My paper awaits evaluation as it involves an enormous cash prize.

So much for puzzles. And I may add that many if not all of the great math'cians delighted in puzzles and challenged one another with tantalising ones. Well thats how Number theory developed!

Mally
mfgoode is offline   Reply With Quote
Old 2007-08-26, 17:03   #10
VolMike
 
VolMike's Avatar
 
Jun 2007
Moscow,Russia

8516 Posts
Default

Quote:
Originally Posted by mfgoode View Post


You are dead right Vol. Speaking for myself yes I do. The aim is to test your knowledge and skill on important parts of Number theory and other topics
by putting it in the form of a puzzle.

You may be interested to know that in presenting a problem for the forum I came across an original theorem. I developed it as no one seemed to have solved it and have presented a paper for publication. I have also claimed that by it I have solved the Beal's conjecture. My paper awaits evaluation as it involves an enormous cash prize.

So much for puzzles. And I may add that many if not all of the great math'cians delighted in puzzles and challenged one another with tantalising ones. Well thats how Number theory developed!

Mally
That's great! I hope we'll see your paper in Interrnet.
VolMike is offline   Reply With Quote
Old 2007-08-27, 06:41   #11
mfgoode
Bronze Medalist
 
mfgoode's Avatar
 
Jan 2004
Mumbai,India

22·33·19 Posts
Post

Quote:
Originally Posted by VolMike View Post
That's great! I hope we'll see your paper in Interrnet.


Thank you VolMike. I will be releasing it on the forum as soon as I have officially recorded it. It is very simple like the Pythagas theorem but true for all real and complex numbers. (I hope!)

Mally
mfgoode is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Digit sum of p of Mp is never 6 or 9? noemata Lounge 3 2016-01-22 10:12
How much digit in the M? Lorenzo Math 17 2010-08-26 16:54
160 digit factor found of 366 digit (PRP-1) AntonVrba Factoring 7 2005-12-06 22:02
10 digit prime in e TTn 15k Search 15 2004-10-18 03:11
The first digit is ... graeme Puzzles 7 2003-09-03 04:27

All times are UTC. The time now is 20:38.


Fri Aug 6 20:38:51 UTC 2021 up 14 days, 15:07, 1 user, load averages: 2.52, 2.70, 2.82

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.