Problem 040

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Post Reply
matt271
Posts: 2
Joined: Thu Jul 16, 2009 6:23 am

Problem 040

Post by matt271 »

i am new here so i dunno if this is ok to do...

anyways i think i have the best solution to Problem 40
An irrational decimal fraction is created by concatenating the positive integers:

0.123456789101112131415161718192021...

It can be seen that the 12^(th) digit of the fractional part is 1.

If d_(n) represents the n^(th) digit of the fractional part, find the value of the following expression.

d_(1) × d_(10) × d_(100) × d_(1000) × d_(10000) × d_(100000) × d_(1000000)
my solution in c99 is: (i hope this hides for non-spoilers)

Code: Select all

edit: uhhhh pm me for the code
the c code itself is not that impressive, but the math i used i think is. i have (what i like to think is) a brilliant method to derive the numbers u see in array a[] :D

does anybody care? anybodys thoughts? i wanted to post this on the thing for it, but its locked for archive.
Last edited by matt271 on Thu Jul 16, 2009 7:03 pm, edited 1 time in total.
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: i think i have the best solution to Problem 40

Post by elendiastarman »

You should edit your post to get rid of that, because hide tag or not, we never want to give easy solutions to others; the spirit of Project Euler is that solvers work it out themselves.
Anyway, I suppose you could pm one of the admins and they might unlock it for a moment, depending on their feelings about the noteworthiness of your new solution. Hope this helps...
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
matt271
Posts: 2
Joined: Thu Jul 16, 2009 6:23 am

Re: i think i have the best solution to Problem 40

Post by matt271 »

my bad
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: i think i have the best solution to Problem 40

Post by hk »

Browsing through the forum I see several solutions that are O(log(n)).
If you think you can do better you can PM me. (Please with explanation, and not only code).
If it is as brilliant as you suggest it is, I could open the forum temporarily.
Image
War ruins the life and health of untold numbers of innocent children.
User avatar
Georg
Posts: 157
Joined: Mon Jan 21, 2008 7:00 am
Location: Mannheim, Germany
Contact:

Re: Problem 040

Post by Georg »

matt271 wrote:anyways i think i have the best solution to Problem 40
[...]
i wanted to post this on the thing for it, but its locked for archive.
Have you read all 187 posts in the thread for problem 40? I don't think so.
Read euler's posts to understand why some threads are locked.
karenhunt6116
Posts: 18
Joined: Tue Sep 29, 2009 4:43 pm
Location: Detroit, MI

Problem 40

Post by karenhunt6116 »

after .....919294949596979899 what is next?

karen
User avatar
stijn263
Posts: 1505
Joined: Sat Sep 15, 2007 11:57 pm
Location: Netherlands

Re: Problem 40

Post by stijn263 »

after 919294949596979899 i'd guess 919294949596979900.

But I think you mean:
91 92 94 94 95 96 97 98 99

And made a typo. In that case, it is followed by 100101102...
allenfantasy
Posts: 2
Joined: Mon Feb 15, 2010 1:04 pm

Re: Problem 040

Post by allenfantasy »

Actually i've done this by hand...some calculations lead to success.
tijko
Posts: 6
Joined: Sun Jun 17, 2012 11:59 pm

Re: Problem 040

Post by tijko »

[link]Problem 040[/link]

I feel this should be obvious and since I'm going to be one of only people to be unsure of it but, is this some kind of permutation of '0.123456789'?

Or is it a pattern of '101112131415161718192021222324......' all the way through 1-9(and 0) then repeat?
TripleM
Posts: 384
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 040

Post by TripleM »

I'm not quite sure what you're asking, but the first line of the problem says the sequence is formed by concatenating the positive integers - positive integers don't stop at 9 or 99, they continue forever. So there's no repeating or permutations involved.
tijko
Posts: 6
Joined: Sun Jun 17, 2012 11:59 pm

Re: Problem 040

Post by tijko »

TripleM thanks for such a quick response and that really helped. What I was unclear about, was that I wasn't making a distinction between, say '11' and a pattern sequence '1,1' (in my mind).

I knew that irrational numbers do not repeat, so the direction I started to think was that there was suppose to be more and more of '111's (or any 1-9) in front of the each number (1-9) after each cycle.

The other thing I would revert to thinking was that it was a pattern cycle and that wouldn't make it irrational, so thats where I was just grasping with the permutation thing.
Post Reply